node.js - pm2与node@4.5.0版本不兼容吗并且每次切换node版本会提示pm2无此命令
PHP中文网
PHP中文网 2017-04-17 14:47:36
0
2
839

我今天把node从4.4.7升级到4.5.0,发现pm2不可用了,可以启动,显示当前文件被启动,并监听,但浏览器无法打开页面了。
切回4.4.7版本后,一切正常。这是一个问题。
第二个问题是:
为什么每次切换node版本后,pm2会提示无此命令?然后我就要再重新安装一次才行。
请问有遇到这两个问题的朋友吗

PHP中文网
PHP中文网

认证0级讲师

reply all(2)
大家讲道理

If you use nvm, npm install is for the node version, and packages of different versions are not shared

大家讲道理

If you do not set a global installation path, the default is the node installed under your lib/node_modules version, so when you switch node versions, you will find that the node_modules installed globally in the previous node version cannot be found. , so you need to set the global installation path

 export NODE_PATH="/path/to/global/node_modules" #指定 NODE_PATH 变量

If you have bash, add it in .bash_profile. If you use zsh, add it in .zshrc

Remember source to let it take effect.

The issue of inaccessibility has been activated. I need to take a look at your code (post part of your code to see). I can’t give an answer for the time being. I hope it will be helpful to you

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template