[英]Cannot install pm2 in OS 10.15.5
Mac os Catalina 10.15.5 / npm version 6.14.5
When I install pm2, it seems that it is being installed without any problem.当我安装 pm2 时,它似乎正在安装没有任何问题。 But if I run pm2, the terminal only says that command not found.
但是如果我运行 pm2,终端只会说找不到该命令。 It's not working at all.
它根本不起作用。 It just doesn't start.
它只是没有开始。
I searched through StackOverflow and tried the following solutions.我搜索了 StackOverflow 并尝试了以下解决方案。
- npm i -g pm2
- sudo npm install -g pm2
- npm i pm2@latest --no-optional -g --no-shrinkwrap
- sudo npm install pm2 -g --unsafe-perm
All of the above gives me this result.以上所有都给了我这个结果。
/Users/myname/.npm-global/bin/pm2 -> /Users/myname/.npm-global/lib/node_modules/pm2/bin/pm2
/Users/myname/.npm-global/bin/pm2-docker -> /Users/myname/.npm-global/lib/node_modules/pm2/bin/pm2-docker
/Users/myname/.npm-global/bin/pm2-dev -> /Users/myname/.npm-global/lib/node_modules/pm2/bin/pm2-dev
/Users/myname/.npm-global/bin/pm2-runtime -> /Users/myname/.npm-global/lib/node_modules/pm2/bin/pm2-runtime
+ pm2@4.4.0
updated 1 package in 4.768s
After this,在这之后,
If I type pm2
: I get pm2-bash: pm2: command not found
如果我输入
pm2
:我得到pm2-bash: pm2: command not found
If I type whereis pm2
: it just doesn't do anything at all.如果我输入
whereis pm2
:它根本不做任何事情。
If I type pm2 start index.js
in VScode terminal: zsh: command not found: pm2
如果我在 VScode 终端中键入 pm2
pm2 start index.js
: zsh: command not found: pm2
And there are the files inside of the path( /Users/myname/.npm-global/bin/
).并且路径中有文件(
/Users/myname/.npm-global/bin/
)。 I don't know what the problem is.我不知道问题是什么。 Any help or advice will be appreciated.
任何帮助或建议将不胜感激。
those who are having the same problem, hope it helps.有同样问题的朋友,希望对你有帮助。 After repeating countless uninstall & install of node/npm/pm2 whatsoever and toying around the permissions, I found answer by myself.
在重复无数次卸载和安装 node/npm/pm2 并玩弄权限之后,我自己找到了答案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.