node.js - 安装cnpm源时候出这些错误问题,这怎么解决?
天蓬老师
天蓬老师 2017-04-17 15:03:12
0
2
664

安装cnpm源时候出这些错误问题,这怎么解决?

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cnpm" "--registry=https://registry.npm.taobao.org"
npm ERR! node v6.8.0
npm ERR! npm  v3.10.8
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!     at Error (native)
npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!     at Error (native)
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules' }
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/wscart/npm-debug.log
天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(2)
左手右手慢动作

Insufficient permission ('permission denied'), sudo npm install -g xxx

小葫芦

It’s not a source issue. It’s because you don’t have permission
You need to find out the permissions of osx/liunx first
Users don’t have permission to write to the system directory (/usr/local/lib/node_modules)
Users can only write~/or/User/你的账户名 Below

If you have to write to the system directory, enter sudo in front of the command to grant super permissions

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template