npm install报 404 Not Found - GET https://registry.npmjs.org

一、先查看一下有没有设置代理

npm config get proxy
npm config get https-proxy

以上两个命令如果返回null,那么就不需要执行以下命令清理

npm config set https-proxy null
npm config set proxy null

二、重新设置

npm config set registry https://registry.npmjs.org/

 

继续执行其他命令检测是否成功

 % sudo npm install npm -g
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
/usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js
+ npm@6.14.9
updated 1 package in 6.547s

 

posted @ 2018-09-29 09:07  温柔的风  阅读(18728)  评论(1编辑  收藏  举报