vue install 报错 This is a problem related to network connectivity.


在终端安装任何包,执行 npm i均报错

npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
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 代理出错

可尝试依次执行:

npm config get proxy

npm config get https-proxy

两者均返回null,否则,执行set null的命令,再安装淘宝镜像

npm config set registry http://registry.cnpmjs.org/

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

之后可以执行npm i

了解不多,原理方面不太清楚,欢迎多多指教


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2026 CODEPRJ.COM