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

来源:互联网 发布:lg v20 跳过网络验证 编辑:程序博客网 时间:2024/05/13 16:57

问题:使用命令“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:
 
> fsevents@0.3.7 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
hexo-cli@0.1.7 /usr/local/lib/node_modules/hexo-cli
├── abbrev@1.0.7
├── minimist@1.1.2
├── tildify@1.1.0 (os-homedir@1.0.1)
├── bluebird@2.9.34
├── chalk@1.1.0 (escape-string-regexp@1.0.3, supports-color@2.0.0, ansi-styles@2.1.0, has-ansi@2.0.0, strip-ansi@3.0.0)
└── hexo-fs@0.1.3 (escape-string-regexp@1.0.3, graceful-fs@3.0.8, chokidar@0.12.6)
HeMinWon:~ mac$
0 0
原创粉丝点击