正文
解决npm : 无法加载文件 D:\Code\renren-fast-vue\node_modules\.bin\npm.ps1,因为在......
小程序:扫一扫查出行
【扫一扫了解最新限行尾号】
复制小程序
【扫一扫了解最新限行尾号】
复制小程序
解决这个问题:- 看看错误信息:
npm : 无法加载文件 D:\DevPath\nodejs\npm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
+ npm install mini-program-iconfont-cli --save-dev
+ ~~~
+ CategoryInfo : SecurityError: (:) [],PSSecurityException
- 下面是解决方法:
npm : 无法加载文件 D:\DevPath\nodejs\npm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
+ npm install mini-program-iconfont-cli --save-dev
+ ~~~
+ CategoryInfo : SecurityError: (:) [],PSSecurityException
因为在此系统上禁止运行脚本,也就是说没有权限,先用下面命令看看:
get-ExecutionPolicy
如果输出:
Restricted
上面表示受限制的,表示状态是禁止的,那就给个权限:
Set-ExecutionPolicy -Scope CurrentUser
再输入:
RemoteSigned
以上就ok了,如果想验证一下就再输入get-ExecutionPolicy,就会输出RemoteSigned
参考连接:解决npm error:npm : 无法加载文件 D:\DevPath\nodejs\npm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅......._普歌-高禄-CSDN博客