npm安装依赖报错npm ERR! code ENOTFOUND npm ERR! errno ENOTFOUND
【摘要】
npm安装依赖报错 使用npm安装一个依赖包时报错,报错内容如下:
[root@D20L42 qtone-resource-fe]# npm install -g cnpm --registry=htt...
npm安装依赖报错
使用npm安装一个依赖包时报错,报错内容如下:
[root@D20L42 qtone-resource-fe]# npm install -g cnpm --registry=https://registry.npm.taobao.org
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npm.taobao.org/cnpm failed, reason: getaddrinfo ENOTFOUND registry.npm.taobao.org registry.npm.taobao.org:443
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! /root/.npm/_logs/2021-06-15T05_39_54_815Z-debug.log
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
解决方法:
npm config get proxy
npm config get https-proxy
npm config set proxy null
npm config set https-proxy null
npm config set registry http://registry.cnpmjs.org/
- 1
- 2
- 3
- 4
- 5
再次安装依赖就不会报错了
npm install -g cnpm --registry=https://registry.npm.taobao.org
- 1
文章来源: jiangxl.blog.csdn.net,作者:Jiangxl~,版权归原作者所有,如需转载,请联系作者。
原文链接:jiangxl.blog.csdn.net/article/details/117922803
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)