安装node.js 环境
pi@raspberrypi:~/workdir/node_js $ wget -qO- https://raw.github.com/creationix/nvm/v0.33.11/install.sh | sh
=> Downloading nvm from git to '/home/pi/.nvm'
=> 正克隆到 '/home/pi/.nvm'...
remote: Enumerating objects: 267, done.
remote: Counting objects: 100% (267/267), done.
remote: Compressing objects: 100% (242/242), done.
remote: Total 267 (delta 31), reused 86 (delta 15), pack-reused 0
接收对象中: 100% (267/267), 119.47 KiB | 7.00 KiB/s, 完成.
处理 delta 中: 100% (31/31), 完成.
=> Compressing and cleaning up git repository
=> Appending nvm source string to /home/pi/.profile
=> bash_completion source string already in /home/pi/.profile
=> Close and reopen your terminal to start using nvm or run the following to use it now:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
使环境变量生效
source ~/.Profile
安装 npm
pi@raspberrypi:~/workdir/node_js $ nvm install stable
Downloading and installing node v11.8.0...
Downloading https://nodejs.org/dist/v11.8.0/node-v11.8.0-linux-armv6l.tar.xz...
######################################################################## 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v11.8.0 (npm v6.5.0)
Creating default alias: default -> stable (-> v11.8.0)
设置 npm 镜像源(不然安装很忙)
pi@raspberrypi:~/workdir/hexo $ npm get registry
https://registry.npmjs.org/
pi@raspberrypi:~/workdir/hexo $ npm config set registry http://registry.npm.taobao.org/
pi@raspberrypi:~/workdir/hexo $ npm get registry
http://registry.npm.taobao.org/
安装hexo 客户端
pi@raspberrypi:~/workdir/node_js $ npm install -g hexo-cli
/home/pi/.nvm/versions/node/v11.8.0/bin/hexo -> /home/pi/.nvm/versions/node/v11.8.0/lib/node_modules/hexo-cli/bin/hexo
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/hexo-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})
+ hexo-cli@1.1.0
added 225 packages from 431 contributors in 181.245s