重装node导致Hexo不能正常使用解决办法
2017-02-10 本文已影响241人
mimimomo
title: 重装node导致Hexo不能正常使用解决办法
安装Hexo时,执行“npm install -g hexo-cli“出现错误
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #ffffff}p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #ffffff; min-height: 13.0px}p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #990000; background-color: #000000}span.s1 {font-variant-ligatures: no-common-ligatures}span.s2 {font-variant-ligatures: no-common-ligatures; color: #bfbfbf; background-color: #000000}span.s3 {font-variant-ligatures: no-common-ligatures; color: #990000; background-color: #000000}span.s4 {font-variant-ligatures: no-common-ligatures; color: #d53bd3}span.s5 {font-variant-ligatures: no-common-ligatures; color: #bfbfbf}span.s6 {font-variant-ligatures: no-common-ligatures; color: #000000; background-color: #ffffff}
Darwin 16.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "hexo-cli"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! at Error (native)
npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! at Error (native)
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/xushun/npm-debug.log
提示权限错误,需要申请root执行权限。
执行以下代码:
sudo npm install --unsafe-perm --verbose -g hexo