我知道在 stackoverflow 和其他網站上有很多關于此的問題,但盡管給出了所有答案,但我無法解決我的問題。一段時間以來,我一直在嘗試通過命令在我的 MERN Stack 專案中安裝 firebase npm i firebase --save。盡管如此,我仍然收到以下錯誤:
npm i firebase --save
npm ERR! code ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! errno ENOTFOUND
npm ERR! network request to http://registry.npmjs.org/firebase failed, reason: getaddrinfo ENOTFOUND your-proxy-url
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 ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Local\npm-cache\_logs\2022-06-15T22_23_35_935Z-debug.log
在互聯網上多次搜索后,我執行了以下命令, npm clear cache --force npm clean cache --force但沒有成功。我什至嘗試過這個命令 npm i firebase --force,不幸的是我得到了同樣的錯誤。我什至從另一個我設法安裝它的專案中復制粘貼 node_modules firebase 包,并將以下行復制到我的 package.json 檔案"firebase": "^9.8.2",中,以便 npm 識別這個包,不幸的是 npm 沒有識別它,因為當我運行時我總是得到與 firebase 相關的相同缺失模塊錯誤。我真的不知道還能做什么。
uj5u.com熱心網友回復:
我在這個網址上找到了解決方案
npm config set registry http://registry.npmjs.org/
這將導致 npm 使用http而不是https. 這意味著 npm 將不再安全,并且會在不執行事先檢查以了解我是否在正確的站點上的情況下進行下載。可能是我的 ISP 阻止了我與該站點的連接,因為我沒有使用代理。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/494071.html
上一篇:npminstall上的ENOTDIR錯誤(節點4上的npm3。我知道:遺留。對不起:()
下一篇:如何解決[webpack-cli]TypeError:cli.isMultipleCompilerisnotafunctionatCommand.<anonymous>
