Day 265/300 ‘proxy‘ config is set properly. See: ‘npm help config‘

(一)需求

在npm install时,报错'proxy' config is set properly. See: 'npm help config',当前的环境是Mac M1芯片的环境,查了很久,终于有有眉目的方案了,分享给大家。

(二)步骤

1、代理置为空

npm config set proxy null
npm config set https-proxy null
# npm config set proxy false    	清除npm中的代理

2、清除npm中的缓存

npm cache clean --force    		清除npm中的缓存

3、使用淘宝源

# npm config set registry http://registry.cnpmjs.org/
npm config set  registry  http://registry.npm.taobao.org/
# npm install --force --registry=https://registry.npm.taobao.org

4、使用cnpm

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

以上是我,搜集到的解决这个问题的方案,希望对你有所帮助~

猜你喜欢

转载自blog.csdn.net/xinghuowuzhao/article/details/127732213
今日推荐