首页 > Web开发 > 详细

npm安装报错整理 npm ERR! network proxy config is set properly See npm help config getaddrinfo EN

时间:2021-04-29 18:16:43      阅读:27      评论:0      收藏:0      [点我收藏+]

使用npm安装总是卡住,跟着网上查看了很多资料,乱乱的。强迫整理下以后观看

npm config set registry https://registry.npm.taobao.org 

这些都不行的话,就是你网的问题了,哈哈哈哈哈哈,1、连手机wifi(估计也不行,你那就是信号不行,)2、就是靠网线的,不行就让人有网线的帮你开个热点时事

1、安装不行问题
(1) 先试试 vsc 和 cmd 指令都可以不
(2) 确定公司没有代理 ,执行:

解决办法: [原文链接](https://www.jianshu.com/p/3fd7d90db01a)

1、执行:

npm config get proxy
npm config get https-proxy
如果返回值不为null,继续执行:
(这一步很重要,一定要保证两个命令的返回值都为null,话说回来,应该出现这个错误这两个返回值有不为null的)
npm config set proxy null
npm config set https-proxy null
2、执行:
npm config set registry http://registry.cnpmjs.org/

3、愉快的下载了:npm install -g cnpm --registry=https://registry.npm.taobao.org

(3)配置公司ip,先上链接原文链接
设置代理

npm config set proxy=http://127.0.0.1:8087
npm config set registry=http://registry.npmjs.org

关于https
经过上面设置使用了http开头的源,因此不需要设https_proxy了,否则还要增加一句:

npm config set https-proxy http://server:port

 


代理用户名和密码

npm config set proxy http://username:password@server:port
npm confit set https-proxy http://username:password@server:port

 

取消代理

npm config delete proxy
npm config delete https-proxy

 

还有配置镜像,这个还没有看,所以小字解释,先上链接原文链接
配置镜像
(1)by config command

npm config set registry http://registry.cnpmjs.org
npm info underscore (如果上面配置正确这个命令会有字符串response)

 

(2)命令行指定

npm --registry http://registry.cnpmjs.org info underscore


(3)编辑 ~/.npmrc 加入下面内容

registry = http://registry.cnpmjs.org

 



npm安装报错整理 npm ERR! network proxy config is set properly See npm help config getaddrinfo EN

原文:https://www.cnblogs.com/CIBud/p/14718467.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!