I’m trying to get rid of the HTTPS proxy settings in NPM. I’ve looked around but most info is about setting up proxies, not removing them. Here’s what I tried:
npm config set http-proxy
npm config set https-proxy
The first command worked fine, but the second one gave me this warning:
npm WARN invalid config proxy=""
npm WARN invalid config Must be a full url with 'http://'
Does this mean I didn’t actually clear the HTTPS proxy? Or can I ignore the warning? I’m not sure if I’ve done it right. Anyone know the proper way to remove these settings completely? Thanks for any help!
To properly remove the HTTPS proxy configuration in NPM, you should use this command:
npm config set https-proxy null
This command clears the proxy setting without triggering any warnings. The empty string you previously used led to the warning because NPM requires a valid URL. After executing the command, verify the config by running:
npm config ls
This will display your current settings, and you should see that the HTTPS proxy has been removed.
I’ve dealt with this issue before, and it can be tricky. The correct way to remove the HTTPS proxy is indeed to set it to null:
npm config set https-proxy null
This clears the setting without triggering warnings. After that, run ‘npm config ls’ to verify it’s gone. If you’re still having issues, sometimes a full reset helps:
npm config rm proxy
npm config rm https-proxy
These commands remove both HTTP and HTTPS proxy settings. Just be aware this might affect other projects if you use different proxies for different work.
In my experience, it’s good practice to double-check your global npmrc file too. Sometimes proxy settings linger there. You can find it in your home directory.