I'm connected via PuTTY ssh to a Linux Server (so it's not supposed to have a GUI).

when I npm install something, due to some intranet network configuration, the http request is redirected as follows

npm i express
npm WARN registry Unexpected warning for http://registry.npmjs.org/: Miscellaneous Warning SELF_SIGNED_CERT_IN_CHAIN: request to https://auth-fw-dc.mycompany.com:nnnn/php/uid.php?...&url=http://registry.npmjs.org%2fexpress failed

Of course the SELF_SIGNED_CERT_IN_CHAIN derives from the redirection to our firewall authentication web portal.

I guess it is a wrong network configuration in our intranet and the http request from npm should not be redirected to our company's firewall especially because I can't open a browser from ssh to authenticate myself there: am I guessing right or is it something I can configure on this machine with some SSH Linux commands for npm?

1 Answer 1


Apparently solved after clearing the npm cache

rm ./package-lock.json
rm -r ./node_modules
npm cache clear --force

and having reconfigured the https connection but without check.

npm set strict-ssl false


npm config set registry https://registry.npmjs.org/

or equivalently

npm config rm registry

(not sure if anything else was done by the network team after I wrote to them)

In conclusion, in my intranet scenario, the issue was due to the following http setting (initial tried to circumvent the ssl issue, see for example SO)

npm config set registry http://registry.npmjs.org/

and solved by removing that wrong command, as said above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.