TypeScript solves the tsc command that cannot run in vscode

1. Command win+R, enter cmd to confirm, enter tsc -v to check whether ts is installed globally

2. If the version number is recognized, it means that ts has been installed globally, but vscode still cannot execute

Solution: 

① Use the win+x shortcut key, the following pop-up window will appear, click the Windows PowerShell with the left mouse button to open the shell.

② Run the set-ExecutionPolicy RemoteSigned command, and select Y or A when asked to change the execution policy

 ③ Run the get-ExecutionPolicy command, you can see that the execution policy of the script has been changed to RemoteSigned

④ Go back to the terminal of vscode, enter the command tsc filename.ts -w, no error will be reported, and the ts file can also be continuously monitored and compiled.

 

 

 

Guess you like

Origin blog.csdn.net/qq_43770056/article/details/129724412
Recommended