npm install命令一直失败的坑(好大呀)
执行npm install命令一直失败,报错主要原因如下:
reason: getaddrinfo EAI_AGAIN registry.npmjs.org 异常分析
这两天一直在vscode终端执行安装
```java PS D:workSoftIntelliJ IDEAworkvuevue-admin-template-master> npm install npm ERR! code EAI_AGAIN npm ERR! errno EAI_AGAIN npm ERR! request to http://registry.cnpmjs.org/axios failed, reason: getaddrinfo EAI_AGAIN registry.cnpmjs.org registry.cnpmjs.org:80 npm ERR! A complete log of this run can be found in: npm ERR! C:Program Files odejs ode_cache\_logs2021-04-15T05_10_34_371Z-debug.log
百度了好大都是下面的方法,主要是代理问题
npm config set proxy null npm config set https-proxy null npm config set registry http://registry.npmjs.org/
所以大家可以把上面语句执行一遍试一下,还有要把权限执行下面语句
npm config set strict-ssl false
如果还不行,建议大家更换vscode,node版本,我使用的是:
node-v10.12.0-x64
VSCodeUserSetup-x64-1.54.3
然后更改为移动热点,依次执行下面图片语句就可以了(不懂是哪一个起了作用)
