欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

npm install安装失败--解决

程序员文章站 2022-05-29 15:45:45
...

npm install 安装时出错,一直安装不成功

npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npm.taobao.org/clipboard failed, reason: connect ETIMEDOUT 112.54.108.89:
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'

解决办法:

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/
然后你就可以愉快的安装cnpm了

npm install  --registry=https://registry.npm.taobao.org 

作者:Sunnky
链接:https://www.jianshu.com/p/3fd7d90db01a
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

相关标签: 前端

上一篇: 沙湾县

下一篇: 平安县