由于校验和不匹配,nvm安装nodejs失败

问题描述

我尝试在流浪汉 ubuntu / bionic64 上使用nvm来安装Node.js,但不幸的是在安装过程中遇到了麻烦。安装命令在我的本地wsl上运行就很好了,不知道为什么在无所事事的盒子上有问题。下面是我的安装命令和安装错误

wget -qO- https://raw.github.com/creationix/nvm/master/install.sh | sh
nvm install 12.18.3
Downloading and installing node v12.18.3...
Local cache found: ${NVM_DIR}/.cache/bin/node-v12.18.3-linux-x64/node-v12.18.3-linux-x64.tar.xz
Computing checksum with sha256sum
Checksums do not match: '7bedb667857950ad616bc1be0be5d96c7e5ba7e1d99f544df54f1fa7d07b67be' found,'b79e02e48d0a1ee4cd4ae138de97fda5413542f2a4f441a7d0e189697b8da563' expected.
Checksum check Failed!
Removing the broken local cache...
Downloading https://nodejs.org/dist/v12.18.3/node-v12.18.3-linux-x64.tar.xz...
##################################################################################################################################################### 100.0%Computing checksum with sha256sum
Checksums do not match: 'ed85d09bce5a33233ffad2e905e9cdf85d195b1005d1a3579c86381a86dc8e0d' found,'b79e02e48d0a1ee4cd4ae138de97fda5413542f2a4f441a7d0e189697b8da563' expected.
xz: (stdin): Compressed data is corrupt
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting Now
Binary download Failed,trying source.
Detected that you have 1 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-v12.18.3/node-v12.18.3.tar.xz
Computing checksum with sha256sum
Checksums do not match: 'be461dce2b2b5cc22aa3752dadd38513053a2b5b0fc6d608a3e7d520066c51cc' found,'71158026579487422fd13cc2553b34cddb76519098aa6030faab52f88c6e0d0e' expected.
Checksum check Failed!
Removing the broken local cache...
Downloading https://nodejs.org/dist/v12.18.3/node-v12.18.3.tar.xz...
##################################################################################################################################################### 100.0%Computing checksum with sha256sum
Checksums do not match: 'd842d965b6bc5f051c9ca0cbe7b7c93878e9bc042f1e9a731bc84107ceb6cb5b' found,'71158026579487422fd13cc2553b34cddb76519098aa6030faab52f88c6e0d0e' expected.
xz: (stdin): Compressed data is corrupt
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting Now
nvm: install v12.18.3 Failed!

解决方法

请参见this post

有类似的问题。我按照说明禁用Windows Hyper-V,现在我的校验和问题已随Vagrant / Virtualbox / NVM安装而消失。可悲的是,这似乎使我使用更多的Docker混乱,因此虽然可以解决此问题,但治愈的方法可能更糟。