node.js - npm全局安装,提示没有写入权限
PHP中文网
PHP中文网 2017-04-17 15:07:52
0
2
488
 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中文网

认证0级讲师

membalas semua(2)
巴扎黑

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

巴扎黑

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

Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan