安装:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
执行命令:
export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
安装node:
nvm ls-remote 显示 N/A
然后调用一下:curl -v https://nodejs.org/dist/ 发现
* Adding handle: conn: 0x7fc4ea003000
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fc4ea003000) send_pipe: 1, recv_pipe: 0
* About to connect() to nodejs.org port 443 (#0)
* Trying 104.20.23.46...
* Connected to nodejs.org (104.20.23.46) port 443 (#0)
* Unknown SSL protocol error in connection to nodejs.org:-9805
* Closing connection 0
curl: (35) Unknown SSL protocol error in connection to nodejs.org:-9805
所以nvm在获取远端仓库的时候,就获取不到版本信息,是因为本身的ssl有问题,所以:
export NVM_NODEJS_ORG_MIRROR=http://nodejs.org/dist 向远方仓库采用http请求