Read the document to learn typeScript. When executing typeScript compilation, an error occurs. The error message is as follows:
tsc : Could not load file C:\Users\Sukeri1\AppData\Roaming\npm\tsc.ps1 because running scripts is prohibited on this system. For
more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
Location line: 1 character: 1
+ tsc hello.ts
+ ~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
Note: Do not do the following operations
Baidu took a look, the blog said to open Windows PowerShell and do the following: set-ExecutionPolicy RemoteSigned
Enter according to the error prompt in the above figure: Set-ExecutionPolicy -Scope CurrentUser
I directly read the solution written in this blog, and it also solved the problem
①Enter get-ExecutionPolicy, if it is Restricted, it will not work
②Enter Set-ExecutionPolicy -Scope CurrentUser, then enter RemoteSigned
③ Check get-ExecutionPolicy, if it is RemoteSigned, it is OK
④ Compile again:
It worked! ! !
At this point, you can see that a js file has been generated under the folder
The study is still going on, if you encounter problems, please Baidu in time, if Du Niang can’t solve it, ask the boss in time, and record the problems so that you can check them at any time