解决Mac下安装nmp的淘宝镜像失败

安装命令如下:

npm install -g cnpm --registry=https://registry.npm.taobao.org --verbose
  •  

提示报错,信息如下:

npm ERR! Darwin 16.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cnpm" "--registry=https://registry.npm.taobao.org" "--verbose"
npm ERR! node v6.11.0
npm ERR! npm  v3.10.10
npm ERR! path ../lib/node_modules/cnpm/bin/cnpm
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall symlink

npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/cnpm/bin/cnpm' -> '/usr/local/bin/cnpm'
npm ERR!     at Error (native)
npm ERR!  { Error: EACCES: permission denied, symlink '../lib/node_modules/cnpm/bin/cnpm' -> '/usr/local/bin/cnpm'
npm ERR!     at Error (native)
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '../lib/node_modules/cnpm/bin/cnpm',
npm ERR!   dest: '/usr/local/bin/cnpm' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.
npm verb exit [ -13, true ]

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/xxx/npm-debug.log

注意到这一句提示: 
Please try running this command again as root/Administrator 
于是将命令最后改为如下所示,成功安装

sudo npm install -g cnpm --registry=https://registry.npm.taobao.org --verbose

 转自:https://blog.csdn.net/w815878564/article/details/73557505

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值