解决 cnpm : 无法加载文件 cnpm.ps1

倖福魔咒の 提交于 2019-12-09 22:37:08

安装 cnpm

npm install -g cnpm --registry=https://registry.npm.taobao.org

在使用 power shell 运行 cnpm 时报以下错误:

cnpm : 无法加载文件 C:\Users\Administrator\AppData\Roaming\npm\cnpm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。所在位置 行:1 字符: 1
cnpm install amfe-flexible

解决方法:
1、以管理员身份运行 power shell
2、输入 set-ExecutionPolicy RemoteSigned ,然后输入A 回车
在这里插入图片描述

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!