npm install报错ERR! code ETIMEDOUT的解决办法

今天重装系统,使用 npm install 安装组件报错:

D:\vue>w3h5>npm i cnpm -g
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/graceful-readlink failed, reason: connect ETIMEDOUT 104.16.25.35: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!     C:\Users\Deshun\AppData\Roaming\npm-cache\_logs\2020-06-01T03_09_36_539Z-debug.log

在网上查了一下,找到解决方法:

执行下面两行代码,清除代理和缓存,问题解决。

npm config set proxy false
npm cache clean


未经允许不得转载:Web前端开发资源网 » npm install报错ERR! code ETIMEDOUT的解决办法

推荐阅读:

WebStorm 显示行号+自动换行+鼠标滚轮缩放设置

使用flexible后 不同设备的data-dpr还始终为1解决方法

HTML页面 用CSS实现禁止选中、复制和右键

利用css中的伪类 给元素设置特殊样式效果

Z-Blog后台无法安装、更新应用的解决方法

赞 (3)
分享到: +

评论 沙发

Avatar

换个身份

  • 昵称 (必填)
  • 邮箱 (选填)