vscode终端tsc报错:tsc : 无法加载文件 C:\Users\沿心宝宝\AppData\Roaming\npm\tsc.ps1,因为在此系统上禁止运行脚本

ts练习时在vscode终端使用tsc编译ts文件时报错如下:
在这里插入图片描述
解决方案:

1.管理员身份打开WindowsPowerShell
在这里插入图片描述

  1. 输入命令set-ExecutionPolicy RemoteSigned,然后输入y即可
    在这里插入图片描述
  2. 就可在终端tsc将ts编译成js文件

猜你喜欢

转载自blog.csdn.net/weixin_46724655/article/details/124588718