I recently changed my network environment and now my NPM installs are failing because the client is still trying to connect to a corporate proxy that no longer exists. I’ve tried setting new values, but I really just want to reset everything to default. What are the specific terminal commands to clear both the HTTP and HTTPS proxy configurations in NPM to restore direct internet connectivity for my Software Development projects?
3 answers
To fully reset your proxy settings in NPM, you need to use the config delete command for both the standard and secure protocols. Open your terminal and run npm config delete proxy followed by npm config delete https-proxy. After running these, it is a good idea to verify the changes by running npm config get proxy and npm config get https-proxy; both should return "null" or "undefined." This is a standard troubleshooting step in Software Development when moving from a firewalled office environment to an open network, ensuring the package manager doesn't hang on dead connections.
If you run those commands and still see the proxy being used, have you checked your global .npmrc file or your system environment variables like HTTP_PROXY and HTTPS_PROXY?
You can also try running npm config list to see a full breakdown of where every setting is being loaded from, which helps identify if a local project-level .npmrc is overriding your global changes.
I agree with Deborah. Checking the config list is the fastest way to debug configuration precedence, which is a common source of confusion in complex Software Development environments.
Steven, you were spot on! Even after deleting the NPM config, the proxy persisted because I had a global environment variable set in my Windows Advanced System Settings. In the world of Software Development, we often forget that NPM inherits from the OS. Once I deleted those environment variables and restarted my terminal, everything started working perfectly. Thanks for pointing out the scope of where these settings can hide!