npm install --save-dev webpack 安装报错之为npm设置代理

问题描述

进行wepack打包工具安装时候报错如下:

npm install --save-dev webpack
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/webpack failed, reason: connect ETIMEDOUT 104.16.19.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'

处理步骤

<1> 首先,取消npm代理设置:

#输入命令:
npm config set proxy null

<2>取消https-proxy

npm config set https-proxy null

<3>然后添加淘宝镜像:

#输入命令:
npm --registry https://registry.npm.taobao.org info underscore

<4>在.npmrc文件中添加代理:
.npmrc一般在用户目录下:C:\Users\for jld.npmrc

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

之后就可以愉快玩耍了。如下:
在这里插入图片描述

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Ernest ZZ

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值