当我尝试使用nvmi安装某些版本的节点时,我得到了这个消息我严格按照页面上的说明操作是行不通的。
Downloading and installing node v14.17.6...
Downloading https://nodejs.org/dist/v14.17.6/node-v14.17.6-linux-x64.tar.xz...
Warning: Failed to create the file
Warning: /home/facundo/.nvm/.cache/bin/node-v14.17.6-linux-x64/node-v14.17.6-li
Warning: nux-x64.tar.xz: Permission denied
curl: (23) Failure writing output to destination
Binary download from https://nodejs.org/dist/v14.17.6/node-v14.17.6-linux-x64.tar.xz failed, trying source.
grep: /home/facundo/.nvm/.cache/bin/node-v14.17.6-linux-x64/node-v14.17.6-linux-x64.tar.xz: No such file or directory
Provided file to checksum does not exist.
Binary download failed, trying source.
Detected that you have 8 CPU core(s)
Running with 7 threads to speed up the build
Downloading https://nodejs.org/dist/v14.17.6/node-v14.17.6.tar.xz...
Warning: Failed to create the file
Warning: /home/facundo/.nvm/.cache/src/node-v14.17.6/node-v14.17.6.tar.xz:
Warning: Permission denied
curl: (23) Failure writing output to destination
Binary download from https://nodejs.org/dist/v14.17.6/node-v14.17.6.tar.xz failed, trying source.
grep: /home/facundo/.nvm/.cache/src/node-v14.17.6/node-v14.17.6.tar.xz: No such file or directory
Provided file to checksum does not exist.
您没有提供命令和您正在遵循的文档。NVM
的安装非常简单。
(1/4)curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
确保您已经安装了curl。curl --version
给了我7.68.0
(2/4)export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
(3/4)source ~/.bashrc
获取终端中的nvm命令
您现在可以使用nvm
命令了。
(4/4)nvm ls-remote
用于检查可用版本,现在您可以明确选择要安装的版本,或者您可以使用nvm install 'lts/*'
安装最新的lts
版本
来源:Github官方NVM文档