使用命令npm install -g hexo-cli 安装Hexo报错问题

问题:使用命令“npm install -g hexo-cli”安装hexo时出现错误,需要在命令行前加上sudo,即“sudo npm install -g hexo-cli

Last login: Fri Jul 31 17:49:43 on ttys000


HeMinWon:~ mac$ npm install -g hexo-cli


npm ERR! Darwin 14.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "hexo-cli"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! path /usr/local/lib/node_modules/hexo-cli
npm ERR! code EACCES
npm ERR! errno -13

npm ERR! Error: EACCES, rmdir '/usr/local/lib/node_modules/hexo-cli'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES, rmdir '/usr/local/lib/node_modules/hexo-cli']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/usr/local/lib/node_modules/hexo-cli' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES, rmdir '/usr/local/lib/node_modules/hexo-cli'
npm ERR! error rolling back     at Error (native)
npm ERR! error rolling back  { [Error: EACCES, rmdir '/usr/local/lib/node_modules/hexo-cli']
npm ERR! error rolling back   errno: -13,
npm ERR! error rolling back   code: 'EACCES',
npm ERR! error rolling back   path: '/usr/local/lib/node_modules/hexo-cli' }

npm ERR! Please include the following file with any support request:

npm ERR!     /Users/mac/npm-debug.log


HeMinWon:~ mac$ sudo npm install -g hexo-cli
Password:
 
> [email protected] install /usr/local/lib/node_modules/hexo-cli/node_modules/hexo-fs/node_modules/chokidar/node_modules/fsevents
> node-gyp rebuild

  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
  SOLINK_MODULE(target) Release/fse.node
/usr/local/bin/hexo -> /usr/local/lib/node_modules/hexo-cli/bin/hexo
[email protected] /usr/local/lib/node_modules/hexo-cli
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected])
HeMinWon:~ mac$

你可能感兴趣的:(hexo)