Skip to main content

Node Version Manager and failing certificate verification

· One min read
Matej Jelluš
IT enthusiast that loves to write code and trying new things. Currently working in Bratislava as CTO in Kontentino.

In my current job, we have some kind of network settings ( or better proxy settings ) that from time to time cause problems with certificate verification.

nvm ls-remote

I used nvm to install node and npm on my computer. Few days ago I needed to change my node version to newer one. It is very easy with nvm, you just list all versions and choose which one you want. So I typed…

$ nvm ls-remote

This command should list all available versions of node. But all I got was :

N/A

The problem in this case is with certificate verification. Nvm doesn’t have any option to disable this, but when you read the docs carefully, there is option to set $NVM_NODEJS_ORG_MIRROR variable. So you can do the following :

$ export NVM_NODEJS_ORG_MIRROR=http://nodejs.org/dist

And now everything works, because there is no need to check certificate when it is only http. The nvm ls-remote command outputs :

v0.1.14
v0.1.15
v0.1.16
...
v8.8.1
v8.9.0 (Latest LTS: Carbon)
v9.0.0

And then you can install any version you want :

$ nvm install <version>

References

GitHub – nvm


Did you like this post? Was it helpful? I am always learning and trying new technologies. When I struggle with something and finally manage to solve it, I share my experience.