I have read lots of issues about this, but still have this problem.(OS : Ubuntu 16.04 LTS)
Output of curl -v $NVM_NODEJS_ORG_MIRROR
* Trying 127.0.0.1... * Connected to 127.0.0.1 (127.0.0.1) port 8087 (#0) * Establish HTTP proxy tunnel to nodejs.org:443 > CONNECT nodejs.org:443 HTTP/1.1 > Host: nodejs.org:443 > User-Agent: curl/7.47.0 > Proxy-Connection: Keep-Alive > < HTTP/1.1 200 OK < * Proxy replied OK to CONNECT request * found 173 certificates in /etc/ssl/certs/ca-certificates.crt * found 697 certificates in /etc/ssl/certs * ALPN, offering http/1.1 * SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256 * server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none * Closing connection 0 curl: (60) server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none More details here: http://curl.haxx.se/docs/sslcerts.html curl performs SSL certificate verification by default, using a "bundle" of Certificate Authority (CA) public keys (CA certs). If the default bundle file isn't adequate, you can specify an alternate file using the --cacert option. If this HTTPS server uses a certificate signed by a CA represented in the bundle, the certificate verification probably failed due to a problem with the certificate (it might be expired, or the name might not match the domain name in the URL). If you'd like to turn off curl's verification of the certificate, use the -k (or --insecure) option.
I have tried following methods:
1, Add export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt in ~/.bashrc
2, Change $NVM_NODEJS_ORG_MIRROR value to http://nodejs.org/dist
3, Run update-ca-certificates
But nvm ls-remote still returns N/A.
One solution is to add -k after curl in nvm.sh,it works,but I would like to know if there is a better solution.
Your system's SSL certificate authorities are out of date. If you can't curl to nodejs.org, then nvm can't work.
@ljharb Sorry,I accidentally commit the issue while typing.
@ljharb Hi,ljharb,I get the Server Certificate by openssl s_client -connect noedjs.org:443 and add it according to How to install certificates for command line,but still have this problem.What am I doing wrong?
Ah, I think I see - you have a proxy through 127.0.0.1, and a .curlrc that enables the proxy option? #877 may be relevant. nvm resets all curl settings, including proxy settings - currently it needs a direct, open connection to nodejs.org
@Vwings may I know that how do you setup proxy setting? via .curlrc or environment variable?
Had same issue on macOS for a few days. Restarting fixed it for me.
Was experiencing this issue and resolved it with this SO question.
I don't use any proxy, just installed nvm via the recommended way, started a new terminal but nvm list available returns N/A.
Also there is no $NVM_NODEJS_ORG_MIRROR or it's empty.
@black-snow are you sure you’re not using nvm-windows, a different project? available is not a thing in nvm.
@ljharb oh crap, you're right. I mix them up everytime. Thanks
Most helpful comment
Your system's SSL certificate authorities are out of date. If you can't
curltonodejs.org, thennvmcan't work.