1 问题
cnpm : 无法加载文件 node_global\cnpm.ps1,因为在此系统上禁止运行脚本
cnpm : 无法加载文件 D:\nodejs\node_global\cnpm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com
/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
+ cnpm install --save-dev electron
+ ~~~~
+ CategoryInfo : SecurityError: (:) [],PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
2 解决方法
- 以管理员身份运行powershell
- 输入Start-Process powershell -Verb runAs
- 弹出新窗口输入set-ExecutionPolicy RemoteSigned 选择 Y
- 执行成功
这样就可以继续使用cnpm
有其他交流的想法,可以加我创建的Q群:820080257