[root@host dev]# npm install -g hexo-cli
/usr/local/dev/node-v10.2/bin/hexo -> /usr/local/dev/node-v10.2/lib/node_modules/hexo-cli/bin/hexo
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/hexo-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
+ hexo-cli@1.1.0
updated 1 package in 5.075s
[root@host dev]# hexo
bash: hexo: command not found
解决办法:
ln -s /usr/local/dev/node-v10.2/lib/node_modules/hexo-cli/bin/hexo /usr/local/bin/hexo
ln -s /usr/local/dev/node-v10.2/bin/node /usr/local/bin/node
ln -s /usr/local/dev/node-v10.2/bin/npm /usr/local/bin/npm
ln -s /usr/local/dev/node-v10.2/lib/node_modules/hexo-cli/bin/hexo /usr/local/bin/hexo