老师问一下 这个怎么解决

来源:2-1 生命周期(上)

慕少5306396

2020-05-07 10:13:26

promote:~ chenyuhui$ sudo npm install -g cnpm --registry=https://registry.npm.taobao.org

Password:

npm ERR! code ENOTFOUND

npm ERR! errno ENOTFOUND

npm ERR! network request to https://registry.npm.taobao.org/ini failed, reason: getaddrinfo ENOTFOUND registry.npm.taobao.org

npm ERR! network This is a problem related to network connectivity.

npm ERR! network In most cases you are behind a proxy or have bad network settings.

npm ERR! network 

npm ERR! network If you are behind a proxy, please make sure that the

npm ERR! network 'proxy' config is set properly.  See: 'npm help config'


npm ERR! A complete log of this run can be found in:

npm ERR!     /Users/chenyuhui/.npm/_logs/2020-05-07T02_12_45_490Z-debug.log


写回答

1回答

好帮手慕言

2020-05-07

同学你好,,可能是由于代理的问题。建议:

先执行 $ npm config set proxy null 将代理设置为空,再重新安装

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

祝学习愉快~

0

0 学习 · 10739 问题

查看课程