search

Home  >  Q&A  >  body text

node.js - 使用nvm安装node出现这个错误,怎么解决?

Could not retrieve https://nodejs.org/dist/lates...

PHP中文网PHP中文网2873 days ago484

reply all(2)I'll reply

  • 怪我咯

    怪我咯2017-04-17 15:53:00

    try again
    check network,try again
    restart try again

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-17 15:53:00

    • nvm install v7.4.0 often due to network (GFW) reasons, now the download of binary is suddenly interrupted in the middle, and then Download source and re-compile can easily cause failure in the endnvm 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

    So I decided to use Thunder or other download tools to download the package and put it in the cache directory of nvm. Finally, use the nvm install command to avoid the need for terminal download interruption. The embarrassment of source code retry, the specific steps are as follows🎜🎜 🎜🎜Download the package https://nodejs.org/dist/v7.4.0/node-v7.4.0-darwin-x64.tar.gz, paste it directly into Thunder and you can download it🎜🎜 🎜🎜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, download it yourself Replace the above ~/Downloads/node-v7.4.0-darwin-x64.tar.gz🎜🎜 with the file storage path 🎜🎜nvm install v7.4.0, it will use 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)

    reply
    0
  • Cancelreply