Vscode terminal tsc error: tsc: Unable to load file C:\Users\Yanxinbao\AppData\Roaming\npm\tsc.ps1, because running scripts is prohibited on this system

When using tsc to compile ts files in the vscode terminal during ts practice, an error is reported as follows:
insert image description here
Solution:

1. Open Windows PowerShell as an administrator
insert image description here

  1. Enter the command set-ExecutionPolicy RemoteSignedand then yenter
    insert image description here
  2. You can compile ts into a js file in the terminal tsc

Guess you like

Origin blog.csdn.net/weixin_46724655/article/details/124588718