nvm ls-remote results in NA

Today I installed the nvm tool in my Linux server. When I run the ‘nvm ls-remote’ command, I got the below weird message:

#nvm ls-remote

Because the Linux server is behind the company firewall, I have setup the environment variables http_proxy and https_proxy correctly. The network communication should not be blocked. However, the command still resulted in ‘N/A’.

After searching the issue using google, I got a hint that this issue may involves TLS certificate. I had a try using the below command:

# curl -v https://nodejs.org/dist
* About to connect() to proxy xxx.xxx.xxx.xxx port 8000 (#0)
* Trying xxx.xxx.xxx.xxx…
* Connected to xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx) port 8000 (#0)
* Establish HTTP proxy tunnel to nodejs.org:443
> CONNECT nodejs.org:443 HTTP/1.1
> Host: nodejs.org:443
> User-Agent: curl/7.29.0
> Proxy-Connection: Keep-Alive
< HTTP/1.1 200 Connection Established
< Proxy-Agent: Fortinet-Proxy/1.0
* Proxy replied OK to CONNECT request
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* Closing connection 0
curl: (77) Problem with the SSL CA cert (path? access rights?)

From the above command output, the issue may involves SSL CA certificate path. I tried to add the CA certificates for the nodejs.org website to the Linux internal trusted CA certificate file. However, the above command still failed.

Searching the solution to this issue again using google, I found the below blog post:


This post suggests to define an environment variable named NVM_NODEJS_ORG_MIRROR. I had a try and found this method works for my case.

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

Even though this solution works, I was still wondering why nvm doesn’t work well without this environment variable defined. I run the below command to deeply investigate the curl command handling:

strace curl -v https://nodejs.org/dist

I checked the strace command output and found one notable record as below:

stat(“/root/certs”, 0x7ffdb4636e90) = -1 ENOENT (No such file or directory)

Why curl tried to open this directory? I suddenly realized that I configured a .curlrc file for curl a few months ago and defined the capath option for curl. However, the ‘/root/certs’ directory doesn’t exist now.

cat .curlrc
capath = /root/certs

After I removed the .curlrc file, the curl worked well and the ‘nvm ls-remote’ command also worked well.

Excellent!! This nvm ‘N/A’ issue really involves about curl SSL CA certificate path. So if you also encounter this issue, you can check your curl settings.