【TypeScript】tsc: The file C:\Users\XXX\AppData\Roaming\npm\tsc.ps1 could not be loaded because running scripts is prohibited on this system.

【question】

Self-learning TypeScript will definitely encounter different problems

The first problem: an error is reported when executing the .ts file to convert the .js file

【Solution】

Find Windows PowerShell  , right click to run as administrator,

 

And execute the command set-ExecutionPolicy RemoteSigned

 Reply: Y

Go back to vsCode and enter the conversion of ts

Conversion successful!

 

 

Guess you like

Origin blog.csdn.net/Fivelin/article/details/127429334