Could not retrieve https://nodejs.org/dist/lates...
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.gz
Checksums match! Using existing downloaded archive $NVM_DIR/.cache/bin/node-v7.4.0-darwin-x64/node-v7.4.0-darwin-x64.tar.gz
Now using node v7.4.0 (npm v4.0.5)
可以将nvm中node和那npm设置到国内源,在nvm的安装路径下找到settings.txt
添加
node_mirror:npm.taobao.org/mirrors/node/
npm_mirror:npm.taobao.org/mirrors/npm/
5 回答4.8k 阅读✓ 已解决
4 回答2.4k 阅读✓ 已解决
2 回答1.7k 阅读✓ 已解决
5 回答1.9k 阅读
2 回答1.3k 阅读✓ 已解决
3 回答2k 阅读
1 回答3.2k 阅读
try again
check network,try again
restart try again