CentOS安装pm2

前端之家收集整理的这篇文章主要介绍了CentOS安装pm2前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

上一篇《CentOS上安装Node.js–v8.9.0》中在CentOS下安装node.js需要配置环境变量。今天又安装pm2,也需要配置环境变量。
安装:npm install -g pm2
这个一直:

[root@jkyx ~]# npm install -g pm2
/usr/local/src/node-v8.9.0-linux-x64/bin/pm2 -> /usr/local/src/node-v8.9.0-linux-x64/lib/node_modules/pm2/bin/pm2
/usr/local/src/node-v8.9.0-linux-x64/bin/pm2-dev -> /usr/local/src/node-v8.9.0-linux-x64/lib/node_modules/pm2/bin/pm2-dev
/usr/local/src/node-v8.9.0-linux-x64/bin/pm2-docker -> /usr/local/src/node-v8.9.0-linux-x64/lib/node_modules/pm2/bin/pm2-docker
/usr/local/src/node-v8.9.0-linux-x64/bin/pm2-runtime -> /usr/local/src/node-v8.9.0-linux-x64/lib/node_modules/pm2/bin/pm2-runtime
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/pm2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ pm2@2.8.0
added 116 packages and updated 1 package in 11.829s

主要是后面的两个警告:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/pm2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"x64"})

通常npm安装的时候有警告可以直接忽略。这里其实也是。但是执行pm2命令就一直提示不存在pm2这个时候就需要把pm2配置全局变量了。

ln -s /usr/local/src/node-v8.9.0-linux-x64/bin/pm2  /usr/local/bin/pm2

执行这个就好了。

原文链接:https://www.f2er.com/centos/375118.html

猜你在找的CentOS相关文章