报错如下:
npm ERR! Linux 4.15.0-29-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "hexo-cli" "-g"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! path /usr/local/lib
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
把命令改为:
npm install hexo-cli -g
即可
$ hexo -v
hexo-cli: 1.1.0
os: Linux 4.15.0-29-generic linux x64
http_parser: 2.7.1
node: 8.10.0
v8: 6.2.414.50
uv: 1.18.0
zlib: 1.2.11
ares: 1.14.0
modules: 57
nghttp2: 1.30.0
openssl: 1.1.0g
icu: 60.2
unicode: 10.0
cldr: 32.0.1
tz: 2017c