问题描述
Could not retrieve https://nodejs.org/dist/lates...
问题解答
回答1:try againcheck network,try againrestart try again
回答2:nvm install v7.4.0的时候经常性的由于网络(GFW)的原因,现在binary的时候下载到一半突然断了,然后需要download source,重新compile,最终很容易造成失败
所以决定用迅雷或者其他下载工具,下载包,放到nvm的cache目录里面,最后用nvm install命令,免去了终端下载中断之后从源码重试的尴尬,具体步骤如下
下载包 https://nodejs.org/dist/v7.4.0/node-v7.4.0-darwin-x64.tar.gz,直接粘贴到迅雷里面就可以下载了
cd ~/.nvm/.cache/bin/
mkdir node-v7.4.0-darwin-x64 the prefix of file you downloaded
mv ~/Downloads/node-v7.4.0-darwin-x64.tar.gz ~/.nvm/.cache/bin/node-v7.4.0-darwin-x64, 使用自己下载的文件的存放路径替换上面的~/Downloads/node-v7.4.0-darwin-x64.tar.gz
nvm install v7.4.0, it will using the cache binary file, output the following msg
Downloading and installing node v7.4.0...Local cache found: $NVM_DIR/.cache/bin/node-v7.4.0-darwin-x64/node-v7.4.0-darwin-x64.tar.gzChecksums match! Using existing downloaded archive $NVM_DIR/.cache/bin/node-v7.4.0-darwin-x64/node-v7.4.0-darwin-x64.tar.gzNow using node v7.4.0 (npm v4.0.5)