问题描述:
在进行cnpm install的时候报错,出现以下的提示:
PS C:\Users\xxxx\Desktop\vscode\my-component> cnpm install
cnpm : 无法加载文件 C:\Users\lulei\AppData\Roaming\npm\cnpm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
+ cnpm install
+ ~~~~
+ CategoryInfo : SecurityError: (:) [],PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
解决方案:
在windows10 系统中打开Windows PowerShell,选择“以管理员身份运行”
输入set-ExecutionPolicy RemoteSigned,然后更改权限为A,最后通过 get-ExecutionPolicy查看当前的状态
修改之后就可以正常发安装了。