I\'m trying to update the npm (node package manager) using the command: npm install npm@latest -g but I\', getting the following error in the command prompt:
does
I got a similar error when I was using Node JS behind a proxy server. Here's what I had to do to fix it:
npm config set proxy http://jdoe:password123@proxy.company.com:8080
npm config set https-proxy http://jdoe:password123@proxy.company.com:8080
Just replace "jdoe" and "password123" with your own credentials to access the proxy server. Everything after the @ is the server domain name, or you can enter the exact IP address too. In my case, both addresses were HTTP (not HTTPS).
To confirm the changes, you can type:
npm config list
and your settings should be listed.
You can get the proxy settings (address) from your browser too.