vue項目在執行npm install時報錯


npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning ETIMEDOUT: request to https://registry.npmjs.org/@babel%2fparser failed, reason: connect ETIMEDOUT 104.16.20.35:443
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/@babel%2fplugin-syntax-export-namespace-from failed, reason: connect ETIMEDOUT 104.16.20.35:443
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 config set proxy null ,然后在執行npm install   

第二種情況:可以安裝淘寶鏡像,通過鏡像安裝依賴,npm install -g cnpm  然后 cnpm install 

 

本人試了以上兩種方法都未成功,看了一些帖子上說的出現這種情況的主要原因,最主要就是網絡差的原因,然后我用自己手機的熱點一次性成功了,如果你也遇到這種情況換一個網速好的網試試應該就可以了!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM