首页 > linux用npm安装hexo失败?

linux用npm安装hexo失败?

jjq@jjq:~/git/hexo$ sudo npm install hexo-cli -g
/usr/local/bin/hexo -> /usr/local/lib/node_modules/hexo-cli/bin/hexo

> dtrace-provider@0.6.0 install /usr/local/lib/node_modules/hexo-cli/node_modules/dtrace-provider
> node scripts/install.js

sh: 1: node: not found
npm WARN install:dtrace-provider@0.6.0 dtrace-provider@0.6.0 install: `node scripts/install.js`
npm WARN install:dtrace-provider@0.6.0 spawn ENOENT

> hexo-util@0.6.0 postinstall /usr/local/lib/node_modules/hexo-cli/node_modules/hexo-util
> npm run build:highlight


> hexo-util@0.6.0 build:highlight /usr/local/lib/node_modules/hexo-cli/node_modules/hexo-util
> node scripts/build_highlight_alias.js > highlight_alias.json

sh: 1: node: not found

npm ERR! Linux 4.4.0-31-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "build:highlight"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! hexo-util@0.6.0 build:highlight: `node scripts/build_highlight_alias.js > highlight_alias.json`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the hexo-util@0.6.0 build:highlight script 'node scripts/build_highlight_alias.js > highlight_alias.json'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the hexo-util package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/build_highlight_alias.js > highlight_alias.json
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs hexo-util
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls hexo-util
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/local/lib/node_modules/hexo-cli/node_modules/hexo-util/npm-debug.log
/usr/local/lib
└── (empty)

npm WARN optional Skipping failed optional dependency /hexo-cli/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14
npm ERR! Linux 4.4.0-31-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "hexo-cli" "-g"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! hexo-util@0.6.0 postinstall: `npm run build:highlight`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the hexo-util@0.6.0 postinstall script 'npm run build:highlight'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the hexo-util package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run build:highlight
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs hexo-util
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls hexo-util
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/jjq/git/hexo/npm-debug.log
npm ERR! code 1

这是出错日志,请问是什么原因?


确保nodejs安装好了 参考

#!/bin/bash
wget --no-check-certificate https://raw.github.com/creationix/nvm/master/install.sh
chmod +x install.sh
./install.sh
echo "reopen terminal and run 'nvm install 4.3.2' to install nodejs"
rm -rf install.sh
#echo "add PATH=/youHomeDir/.nvm/versions/node/v4.3.2/bin:\$PATH to ~/.profile"

你的npm以及nodejs安装上了吗?

【热门文章】
【热门文章】