NPM报错记录
文章目录
终端输入vue -V报错在此系统上禁止运行脚本
PS C:\Users\Administrator> vue -V
vue : 无法加载文件 D:\nodejs\node_global\vue.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
+ vue -V
+ ~~~
+ CategoryInfo : SecurityError: (:) [],PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess解决方案:
- 使用管理员模式启动终端
- 执行命令:
get-ExecutionPolicy(取得shell的当前执行策略),显示Restricted(表示状态是禁止的) - 执行命令:
set-ExecutionPolicy RemoteSigned - 执行命令:
get-ExecutionPolicy,显示RemoteSigned则可以正常使用了
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论