【发布时间】:2017-08-27 19:09:02
【问题描述】:
【问题讨论】:
-
你确定它失败了?我看到 2 个警告,没有错误。
-
是的,因为安装后我尝试运行命令 pm2 -v 但它显示'pm2'无法识别
标签: node.js npm pm2 forever nodemon
【问题讨论】:
标签: node.js npm pm2 forever nodemon
试试,
npm cache clear -f
和,
npm install pm2 -g --unsafe-perm
【讨论】:
Windows 10 内置了默认限制任何脚本执行的执行策略。所以,你必须先设置策略。
在Powershell(管理员权限)中,先用命令查看ExecutionPolicy
Get-ExecutionPolicy -List
“未定义”政策意味着像 pm2 这样的脚本将受到限制。要启用它,请运行命令
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
然后,尝试运行 pm2。
【讨论】: