问题描述
在学习webpack安装安装一个插件css-minimizer-webpack-plugin时,出现如下报错:
PS D:\learnwebpack> npm install css-minimizer-webpack-plugin -D
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/css-minimizer-webpack-plugin failed, reason: connect ETIMEDOUT 104.16.19.35:443
npm ERR! network This is a problem related to network connectivity.
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\ASUS\AppData\Local\npm-cache\_logs\2022-04-14T07_24_19_324Z-debug.log
可以看出这是代理proxy出的问题。
解决方案:
查看自己的代理:
然后清除代理和缓存:
就可以正常进行安装了。