解决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

以上这篇解决Mac下安装nmp的淘宝镜像失败问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持呐喊教程。

声明:本文内容来源于网络,版权归原作者所有,内容由互联网用户自发贡献自行上传,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任。如果您发现有涉嫌版权的内容,欢迎发送邮件至:notice#nhooo.com(发邮件时,请将#更换为@)进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。