简体   繁体   中英

NPM issue on Mac

I had been using VS Code for my development works, when all of a sudden my npm install commands stopped working and started giving me errors like below:

⸨░░░░░░░░░░░░░░░░░░⸩ ⠧ rollbackFailedOptional: verb npm-session abcd123456789efg

npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! network request to https://registry.npmjs.org/passport failed, reason: read ECONNRESET
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!     /Users/ajaywadhwani/.npm/_logs/2019-01-27T22_33_38_087Z-debug.log

I am not behind any proxy by any chance.

Interestingly, a ping to the link https://registry.npmjs.org/passport through my browser takes me to the webpage with the content, and can ping the website through terminal.

Kindly advise and suggest.

Try updating to the latest version npm with the command npm install npm@latest -g .

I would also make sure there's no proxy set up by going to System Preferences > Network > your connection (Wi-Fi, for example) > Advanced... > Proxies and looking for any checked boxes.

Please let me know if these solutions work or not.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM