nvm
nvm copied to clipboard
I can't use nvm install node, help me
I can't use nvm install node, help me
error :
Downloading and installing node v8.2.1...
Local cache found: $NVM_DIR/.cache/bin/node-v8.2.1-linux-x64/node-v8.2.1-linux-x64.tar.xz
Computing checksum with sha256sum
Checksums do not match: 'f74e70e2c3c6d96e887286e605480f64487cd543f4a5988b29f491b32f1256c8' found, 'abcddeb95cc4465953b1edb0922d20e9b0b3de83688fc8150b863117032a978a' expected.
Checksum check failed!
Removing the broken local cache...
Downloading https://npm.taobao.org/mirrors/node/v8.2.1/node-v8.2.1-linux-x64.tar.xz...
######################################################################## 100.0%
Computing checksum with sha256sum
Checksums do not match: 'f74e70e2c3c6d96e887286e605480f64487cd543f4a5988b29f491b32f1256c8' found, 'abcddeb95cc4465953b1edb0922d20e9b0b3de83688fc8150b863117032a978a' expected.
xz: (stdin): File format not recognized
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Binary download failed, trying source.
Additional options while compiling: 8
Local cache found: $NVM_DIR/.cache/src/node-v8.2.1/node-v8.2.1.tar.xz
Computing checksum with sha256sum
Checksums do not match: '9ceab53e0b7dd9771d7ea799d8599d2f1711fe39230692651ec99190d9f8e956' found, '02c46d8914540eea73d0ad33bf9f371a28aa0dc8c5d740948491fef044ad8c8b' expected.
Checksum check failed!
Removing the broken local cache...
Downloading https://npm.taobao.org/mirrors/node/v8.2.1/node-v8.2.1.tar.xz...
######################################################################## 100.0%
Computing checksum with sha256sum
Checksums do not match: '9ceab53e0b7dd9771d7ea799d8599d2f1711fe39230692651ec99190d9f8e956' found, '02c46d8914540eea73d0ad33bf9f371a28aa0dc8c5d740948491fef044ad8c8b' expected.
xz: (stdin): File format not recognized
tar: Child returned status 1
tar: Error is not recoverable: exiting now
nvm: install v8.2.1 failed!
You're downloading from a mirror; and it looks like the checksums aren't valid. What happens if you unset the mirror?
I have the same problem. After I check it, the reason same as #1549 . Command curl need "-L". I see the pull request has been merged, but I still not really clear how to solve it. @ljharb Sholud I add some params?
What does nvm debug
print out? (the issue template is helpful to fill out)
As below:
nvm --version: v0.33.2
$SHELL: /bin/bash
$HOME: /root
$NVM_DIR: '$HOME/.nvm'
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
$NVM_NODEJS_ORG_MIRROR: 'https://npm.taobao.org/mirrors/node'
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)'
uname -a: 'Linux 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux'
OS version: CentOS release 6.5 (Final)
curl: /usr/bin/curl, curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
wget: /usr/bin/wget, GNU Wget 1.12 built on linux-gnu.
git: not found
nvm current: none
which node: which: no node in (/usr/lib/jvm/jdk1.8.0_112/bin:/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:$HOME/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:$HOME/bin:/home/abc/bin)
which iojs: which: no iojs in (/usr/lib/jvm/jdk1.8.0_112/bin:/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:$HOME/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:$HOME/bin:/home/abc/bin)
which npm: which: no npm in (/usr/lib/jvm/jdk1.8.0_112/bin:/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:$HOME/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:$HOME/bin:/home/abc/bin)
npm config get prefix: bash: npm: command not found
npm root -g: bash: npm: command not found
I also test wget & curl.
# work
wget -O node-v6.11.2-linux-x64-taobao.tar.gz https://npm.taobao.org/mirrors/node/v6.11.2/node-v6.11.2-linux-x64.tar.gz
# not work
curl https://npm.taobao.org/mirrors/node/v6.11.2/node-v6.11.2-linux-x64.tar.gz -o node-v6.11.2-linux-x64-taobao.tar.gz
# work, add args '-L'
curl https://npm.taobao.org/mirrors/node/v6.11.2/node-v6.11.2-linux-x64.tar.gz -o node-v6.11.2-linux-x64-taobao.tar.gz -L
Because of 'https://npm.taobao.org/mirrors/node' has a redirection for cdn. So curl can't work with out '-L'. This reason make 'Checksums do not match'.
https://npm.taobao.org/mirrors/node doesn't redirect for me. What does it try to redirect to?
(Regardless, if it redirects, then that's a bug with the taobao mirror, not with nvm. The contract is that the mirror doesn't redirect)
Full URL is 'https://npm.taobao.org/mirrors/node/v6.11.2/node-v6.11.2-linux-x64.tar.gz'.
$ curl -I https://npm.taobao.org/mirrors/node/v6.11.2/node-v6.11.2-linux-x64.tar.gz
HTTP/1.1 302 Found
Date: Tue, 29 Aug 2017 07:22:11 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 177
Connection: keep-alive
Vary: Accept-Encoding
Location: http://cdn.npm.taobao.org/dist/node/v6.11.2/node-v6.11.2-linux-x64.tar.gz
X-Response-Time: 3
Strict-Transport-Security: max-age=15768000
ah, so it's not for the listing, it's for the actual archives, gotcha.
I'm not sure about adding -L
; I'd need to add a similar option for wget
and I'm not sure if it supports it.
Not a bug, I just want use nvm, because it's extremely useful. When I install 6.11.2, show that:
$nvm i 6.11.2
Downloading and installing node v6.11.2...
Downloading https://npm.taobao.org/mirrors/node/v6.11.2/node-v6.11.2-linux-x64.tar.gz...
######################################################################## 100.0%
Computing checksum with sha256sum
Checksums do not match: '592fc528d7b5d3cd172119ae1a6cd07ad997b00ecc89254a8441eecab75baa31' found, '1ca74833ff79e6a3a713a88bba8e7f5f5cda5d4008a6ffeb2293a1bf98f83e04' expected.
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Binary download failed, trying source.
Detected that you have 2 CPU core(s)
Number of CPU core(s) less than or equal to 2, running in single-threaded mode
Local cache found: $NVM_DIR/.cache/src/node-v6.11.2/node-v6.11.2.tar.gz
Computing checksum with sha256sum
Checksums do not match: 'fc52e21098d32faa9d5fc676fda052552fc222d93ecd61c8b41e671b95e08b73' found, '20146ed51b638404665737ed8a25cc06e96d7d7259eb90a4bdec4730a78002a6' expected.
Checksum check failed!
Removing the broken local cache...
Downloading https://npm.taobao.org/mirrors/node/v6.11.2/node-v6.11.2.tar.gz...
######################################################################## 100.0%
Computing checksum with sha256sum
Checksums do not match: 'fc52e21098d32faa9d5fc676fda052552fc222d93ecd61c8b41e671b95e08b73' found, '20146ed51b638404665737ed8a25cc06e96d7d7259eb90a4bdec4730a78002a6' expected.
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
nvm: install v6.11.2 failed!
See '1ca74833ff79e6a3a713a88bba8e7f5f5cda5d4008a6ffeb2293a1bf98f83e04'? It is a right sha256sum result. Simulate it with curl:
$ curl -L https://npm.taobao.org/mirrors/node/v6.11.2/node-v6.11.2-linux-x64.tar.gz -o node-v6.11.2-linux-x64-taobao.tar.gz
$ sha256sum node-v6.11.2-linux-x64-taobao.tar.gz
1ca74833ff79e6a3a713a88bba8e7f5f5cda5d4008a6ffeb2293a1bf98f83e04
Same result, curl with '-L'. I not sure NVM's curl with '-L', because it's too long...I'm a shell noob ;-) I also check sha256sum with curl(no '-L'):
$ curl https://npm.taobao.org/mirrors/node/v6.11.2/node-v6.11.2-linux-x64.tar.gz -o node-v6.11.2-linux-x64-taobao.tar.gz
$ sha256sum node-v6.11.2-linux-x64-taobao.tar.gz
f59b8e796edd29e4c077b925761af5947f28887904caf3a49c05c49ec66a9af9
Not same as NVM's '592fc528d7b5d3cd172119ae1a6cd07ad997b00ecc89254a8441eecab75baa31'. ... Let's change our minds. Can I use 'wget' forcibly? Apologize for my bad English. T_T
1.执行: ls ${NVM_DIR}/.cache/bin/node-v12.20.0-darwin-x64/node-v12.20.0-darwin-x64.tar.xz 2.执行 brew install xz 3.执行: nvm install node版本