簡體   English   中英

npm install 在我的情況下似乎不起作用

[英]npm install does not seem to work in my case

我下載了 node.js,當我運行 CLI 命令npm install -g @angular/cli我收到以下錯誤:

npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to http://registry.npmjs.org/@angular%2fcli failed, reason: getaddrinfo ENOTFOUND proxy.example.com
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\Omar Abdelkefi\AppData\Roaming\npm-cache\_logs\2020-03-08T13_10_01_192Z-debug.log

請任何幫助

如果出現這樣的錯誤...

npm 錯誤! 網絡“代理”配置設置正確

那么你必須正確設置代理

$ npm config set proxy http://XXX.XXX.XXX.XXX:XXXX

$ npm config set https-proxy http://XXX.XXX.XXX.XXX:XXXX

您可以通過以下方式檢查當前代理:

$ npm config get proxy

如果需要刪除代理,請繼續執行:(先嘗試以下

$ npm config rm proxy   
$ npm config rm https-proxy

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM