部署node项目时,npm相关依赖下载都报了400 Bad Request,网上内容搜索建议:
npm config set strict-ssl false 无效果
切换淘宝源操作--无效。
可尝试:
1、查看代理设置执行,不为null时设置为空:
npm config get proxy
npm config get https-proxy
如果返回值不为null,继续执行:
(这一步很重要,一定要保证两个命令的返回值都为null)
npm config set proxy null
npm config set https-proxy null
2、执行:
npm config set registry http://registry.cnpmjs.org/
搞定!