search

Home  >  Q&A  >  body text

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 days ago495

reply all(2)I'll reply

  • 巴扎黑

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

    I have used various search methods, including npm cache clean and so on, but it still doesn't work.

    reply
    0
  • 巴扎黑

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

    Try manually adding permissions to the /tmp folder

    reply
    0
  • Cancelreply