찾다

 >  Q&A  >  본문

node.js - npm全局安装,提示没有写入权限

 workspace sudo npm install -g vue-cli
npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "vue-cli"
npm ERR! node v6.2.0
npm ERR! npm  v3.8.9
npm ERR! path /tmp/npm-476-41426030
npm ERR! code EPERM
npm ERR! errno -1
npm ERR! syscall mkdir

npm ERR! Error: EPERM: operation not permitted, mkdir '/tmp/npm-476-41426030'
npm ERR!     at Error (native)
npm ERR!  { Error: EPERM: operation not permitted, mkdir '/tmp/npm-476-41426030'
npm ERR!     at Error (native)
npm ERR!   errno: -1,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/tmp/npm-476-41426030' }
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/liucheng/workspace/npm-debug.log

如上,在Mac上全局安装,爆出了这个错,已经加了sudo

PHP中文网PHP中文网2785일 전490

모든 응답(2)나는 대답할 것이다

  • 巴扎黑

    巴扎黑2017-04-17 15:09:52

    已经使用了各种能够搜索到的方法,包括npm cache clean等等,但是还是不能行。

    회신하다
    0
  • 巴扎黑

    巴扎黑2017-04-17 15:09:52

    试试手动给/tmp 文件夹加下权限呢

    회신하다
    0
  • 취소회신하다