安装方式:
从官网上下载了64位的已经编译好的包
wget https://nodejs.org/dist/v4.4.7/node-v4.4.7-linux-x64.tar.xz。
安装方法:解压到指定目录
xz -d node-v4.4.7-linux-x64.tar.xz
tar -xvf node-v4.4.7-linux-x64.tar
设置全局访问:
ln -s /home/hexo/downloads/node-v4.4.7-linux-x64/bin/node /usr/local/bin/
ln -s /home/hexo/downloads/node-v4.4.7-linux-x64/bin/npm /usr/local/bin/
效果:通过node --version命令查看node版本为v4.4.7,npm命令能用
- 安装Hexo:
npm install -g hexo-cli
问题
安装时报错,请教是什么问题导致的?
> [email protected] install /home/hexo/downloads/node-v4.4.7-linux-x64/lib/node_modules/hexo-cli/node_modules/hexo-log/node_modules/bunyan/node_modules/dtrace-provider
> node scripts/install.js
sh: node: 未找到命令
npm WARN optional dep failed, continuing [email protected]
> [email protected] postinstall /home/hexo/downloads/node-v4.4.7-linux-x64/lib/node_modules/hexo-cli/node_modules/hexo-util
> npm run build:highlight
sh: npm: 未找到命令
npm ERR! Linux 3.10.0-327.el7.x86_64
npm ERR! argv "/home/hexo/downloads/node-v4.4.7-linux-x64/bin/node" "/usr/local/bin/npm" "install" "-g" "hexo-cli"
npm ERR! node v4.4.7
npm ERR! npm v2.15.8
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] postinstall: `npm run build:highlight`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'npm run build:highlight'.
npm ERR! 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 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/npm-debug.log
/home/hexo/downloads/node-v4.4.7-linux-x64/bin/node 是不是被你删掉了?
请使用nvm管理node版本,不要自行添加软链接。
thank you
Most helpful comment
/home/hexo/downloads/node-v4.4.7-linux-x64/bin/node是不是被你删掉了?请使用nvm管理node版本,不要自行添加软链接。