zoukankan      html  css  js  c++  java
  • npm install 总是报错(Mac OS环境下)

    mac使用npm安装hexo,输入命令:

    npm install -g hexo-cli

    报错如下:

    npm ERR! Darwin 14.5.0

    npm ERR! argv "/Users/wangmaster/.nvm/versions/node/v4.4.2/bin/node" "/Users/wangmaster/.nvm/versions/node/v4.4.2/bin/npm" "install" "-g" "hexo-cli"

    npm ERR! node v4.4.2

    npm ERR! npm  v2.15.0

    npm ERR! path /Users/wangmaster/.nvm/versions/node/v4.4.2/lib/node_modules/hexo-cli/.editorconfig

    npm ERR! code EACCES

    npm ERR! errno -13

    npm ERR! syscall unlink

    npm ERR! Error: EACCES: permission denied, unlink '/Users/wangmaster/.nvm/versions/node/v4.4.2/lib/node_modules/hexo-cli/.editorconfig'

    npm ERR!     at Error (native)

    npm ERR!  { [Error: EACCES: permission denied, unlink '/Users/wangmaster/.nvm/versions/node/v4.4.2/lib/node_modules/hexo-cli/.editorconfig']

    npm ERR!   errno: -13,

    npm ERR!   code: 'EACCES',

    npm ERR!   syscall: 'unlink',

    npm ERR!   path: '/Users/wangmaster/.nvm/versions/node/v4.4.2/lib/node_modules/hexo-cli/.editorconfig' }

    npm ERR! 

    npm ERR! Please try running this command again as root/Administrator.

    npm ERR! error rolling back Error: EACCES: permission denied, unlink '/Users/wangmaster/.nvm/versions/node/v4.4.2/lib/node_modules/hexo-cli/.editorconfig'

    npm ERR! error rolling back     at Error (native)

    npm ERR! error rolling back  { [Error: EACCES: permission denied, unlink '/Users/wangmaster/.nvm/versions/node/v4.4.2/lib/node_modules/hexo-cli/.editorconfig']

    npm ERR! error rolling back   errno: -13,

    npm ERR! error rolling back   code: 'EACCES',

    npm ERR! error rolling back   syscall: 'unlink',

    npm ERR! error rolling back   path: '/Users/wangmaster/.nvm/versions/node/v4.4.2/lib/node_modules/hexo-cli/.editorconfig' }

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

    npm ERR!     /Users/wangmaster/Desktop/Blog/npm-debug.log

    解决方案:

      - 加上sudo执行:

    即:

    sudo npm install -g hexo-cli
    按回车,输入机器密码即可。
  • 相关阅读:
    GITHUB随笔 15-5月 junit
    github心得
    (转)哪个瞬间让你突然觉得逛知乎真有用?
    0-1背包问题(the knapsack problem)
    对VSCode在安装了Dev-cpp的电脑上的配置
    非全日制考研资料(未完待续)
    CSS那些事读书笔记-2
    CSS那些事读书笔记-1
    前端面试准备-1
    工作日记-一个有趣的定时任务实现
  • 原文地址:https://www.cnblogs.com/wangmaster/p/5392532.html
Copyright © 2011-2022 走看看