文章目录
文章目录
前言
powerShell 使用shift+右键可以打开,但是win+x(使用管理员)却无法打开
npm : 无法加载文件 D:\Program Files\nodejs\node_global\npm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:
/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
+ npm run dev
+ ~~~
+ CategoryInfo : SecurityError: (:) [],PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
一、打算用powerShell启动一个Vue项目,结果给我来了这么个报错。
二、因为在此系统上禁止运行脚本,也就是说没有权限,看一下呗:
1. get-ExecutionPolicy 查看权限
get-ExecutionPolicy
2.输出:Restricted :受限制的
Restricted
3.Restricted 表示状态是禁止的,那就给个权限:
Set-ExecutionPolicy -Scope CurrentUser
4.输入:RemoteSigned
RemoteSigned
验证一下:
get-ExecutionPolicy
显示:RemoteSigned 就可以了
运行 npm run install 可以执行