在上一篇《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":"any"} (current: {"os":"linux","arch":"x64"})

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

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

执行这个就好了。

GitHub 加速计划 / li / linux-dash
6
1
下载
A beautiful web dashboard for Linux
最近提交(Master分支:4 个月前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐