0
点赞
收藏
分享

微信扫一扫

[typescript]请使用“以管理员身份运行”选项启动 Windows PowerShell。要更改当前用户的执行策略,请运行 “Set-ExecutionPolicy -Scope Curren

infgrad 2022-04-17 阅读 72

使用node安装完ts环境后,在cmd中使用tsc -V 测试好使,显示了版本号,但是到vscode的终端报错如下:

PS D:\CodeField\basic\ts_vue3\01_TypeScript\自动编译> tsc -V
)作用域的执行策略,请使用“以管理员身份运行”选项启动 Windows PowerShell。要更改当前用户的执行策略,请运行 "Set-ExecutionPolicy -Scope CurrentUser"。        
所在位置 行:1 字符: 1
+ set-ExecutionPolicy RemoteSigned
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (:) [Set-ExecutionPolicy], UnauthorizedAccessException
    + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand

解决:

  1. 打开powershell,以管理员方式
  2. 输入set-ExecutionPolicy RemoteSigned
  3. 回车
  4. 输入A
  5. 回车

问题解决

举报

相关推荐

0 条评论