報錯:
npm ERR! syscall getaddrinfo
npm ERR! errno ENOTFOUND
npm ERR! network request to http://registry.cnpmjs.org/vue-cli failed, reason: getaddrinfo ENOTFOUND registry.cnpmjs.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 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\acer\AppData\Local\npm-cache\_logs\2022-08-07T07_18_12_778Z-debug-0.log
解決方法:
npm ERR! network request to http://registry.cnpmjs.org/vue-cli failed, reason: getaddrinfo ENOTFOUND
這句話已經(jīng)很明顯的提示 http://registry.cnpmjs.org/vue-cli 請求失敗了,但網(wǎng)上其他博客還是讓代理這個路徑。試了網(wǎng)上很多方法都沒有用。最后執(zhí)行了以下語句,執(zhí)行成功文章來源:http://www.zghlxwxcb.cn/news/detail-762365.html
npm config set registry https://registry.npm.taobao.org
直接代理淘寶鏡像。
問題解決文章來源地址http://www.zghlxwxcb.cn/news/detail-762365.html
到了這里,關(guān)于如何解決npm install 的報錯npm ERR! network request to http://registry.cnpmjs.org/vue-cli failed的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!