Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS:vscode安装完typescript执行tsc报错 #75

Open
smileyby opened this issue May 25, 2021 · 0 comments
Open

TS:vscode安装完typescript执行tsc报错 #75

smileyby opened this issue May 25, 2021 · 0 comments
Labels
TypeScript 🐰 TypeScript 相关

Comments

@smileyby
Copy link
Owner

错误信息如下:

无法加载文件:C:\Users\AppData\Roaming\npm\tsc.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅https:/go.microsoft.com/fwlink/?LinkID=135 about_Execution_Policies。

解决办法:

  1. 以管理员身份执行vscode
  2. ctrl+shift+ 打开终端,执行命令:get-ExecutionPolicy` 查看策略状态 显示:Restricted(禁止状态)
  3. 执行:set-ExecutionPolicy RemoteSigned 更新策略状态
  4. 再次执行步骤①,查看策略状态 显示为:RemoteSigned
  5. 此时,即可在vscode上运行 tsc 命令
@smileyby smileyby added the TypeScript 🐰 TypeScript 相关 label May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TypeScript 🐰 TypeScript 相关
Projects
None yet
Development

No branches or pull requests

1 participant