cannot be loaded because running scripts is disabled on this system的对策

1
2
3
4
5
6
7
8
9
PS C:\Dev\typescript> tsc Runoob.ts
tsc : File C:\Users\myname\AppData\Roaming\npm\tsc.ps1 cannot be loaded because running s       
cripts is disabled on this system. For more information, see about_Execution_Policies
 at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ tsc Runoob.ts
+ ~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

  

我遇到的问题是这样的。意思是脚本不被win10允许执行,可能是因为安全性问题,所以我们要修改一下默认设置,可以执行下面命令:右键开始菜单,打开管理员的PowerShell。

执行下面的命令:

1
set-ExecutionPolicy RemoteSigned

  然后问题就解决了。

 

posted @   奥兰王子  阅读(520)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全网最简单!3分钟用满血DeepSeek R1开发一款AI智能客服,零代码轻松接入微信、公众号、小程
· .NET 10 首个预览版发布,跨平台开发与性能全面提升
· 《HelloGitHub》第 107 期
· 全程使用 AI 从 0 到 1 写了个小工具
· 从文本到图像:SSE 如何助力 AI 内容实时呈现?(Typescript篇)
点击右上角即可分享
微信分享提示