node.js - NVM:使用 nvm install 命令拒绝获取权限

标签 node.js linux nvm

我最近全新安装了 Ubuntu 21.04 并想安装 nvm:curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash然后关闭并重新打开终端。请求安装版本 12.16.3 时(也尝试过其他版本)。我收到以下错误:

nvm install 12.16.3
Downloading and installing node v12.16.3...
Downloading https://nodejs.org/dist/v12.16.3/node-v12.16.3-linux-x64.tar.xz...
Warning: Failed to create the file 
Warning: /home/sauronnikko/.nvm/.cache/bin/node-v12.16.3-linux-x64/node-v12.16.
Warning: 3-linux-x64.tar.xz: Permission denied
curl: (23) Failure writing output to destination

Binary download from https://nodejs.org/dist/v12.16.3/node-v12.16.3-linux-x64.tar.xz failed, trying source.
grep: /home/sauronnikko/.nvm/.cache/bin/node-v12.16.3-linux-x64/node-v12.16.3-linux-x64.tar.xz: No such file or directory
Provided file to checksum does not exist.
Binary download failed, trying source.
Downloading https://nodejs.org/dist/v12.16.3/node-v12.16.3.tar.xz...
Warning: Failed to create the file 
Warning: /home/sauronnikko/.nvm/.cache/src/node-v12.16.3/node-v12.16.3.tar.xz: 
Warning: Permission denied
curl: (23) Failure writing output to destination

Binary download from https://nodejs.org/dist/v12.16.3/node-v12.16.3.tar.xz failed, trying source.
grep: /home/sauronnikko/.nvm/.cache/src/node-v12.16.3/node-v12.16.3.tar.xz: No such file or directory
Provided file to checksum does not exist.

最佳答案

发表了 issue到 nvm 的 repo
原来问题出在 curl并且我已经用 snap 安装了它而不是常规 apt install curl .

关于node.js - NVM:使用 nvm install 命令拒绝获取权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67541374/

相关文章:

node.js - 无法使用 NPM 命令 - block 范围声明

javascript - 使用 NodeJS 以 C# 格式访问服务器的 API session 时出现问题

java - 更改浏览器选项卡时,从 Applet 打开的模型对话框位于 Applet 后面

c++ - 从 OS X 迁移到 Linux Red-Hat 时出错

react-native - npm install -g expo-cli 未完成安装

javascript - Node.js nvm 和 npm 目录结构

node.js - 在您的 package.json 中为 react 组件添加依赖项以使用react的正确方法是什么

javascript - npm嵌套依赖,为什么不模仿gem呢?

javascript - API删除不更新数据库

linux - ping命令中的-U选项有什么用?