安装 NVM -curl:(23) 将输出写入目标失败 - 权限被拒绝

问题描述 投票:0回答:1

我试图在 Ubuntu 22.04 上下载节点 18,但是,我无法通过 apt-get 或 nvm 来下载。我需要帮助,因为没有节点我无法开发我的项目。我来自巴西,所以终端上的一些短语是葡萄牙语,我会翻译它们。

终端消息

nvm install 18
Downloading and installing node v18.18.2...
Downloading https://nodejs.org/dist/v18.18.2/node-v18.18.2-linux-x64.tar.xz...
Warning: Failed to open the file                                               
Warning: /home/vinicius_pires/.nvm/.cache/bin/node-v18.18.2-linux-x64/node-v18.
Warning: 18.2-linux-x64.tar.xz: Permission denied
curl: (23) Failure writing output to destination

Binary download from https://nodejs.org/dist/v18.18.2/node-v18.18.2-linux-x64.tar.xz failed, trying source.
grep: /home/vinicius_pires/.nvm/.cache/bin/node-v18.18.2-linux-x64/node-v18.18.2-linux-x64.tar.xz: Arquivo ou diretório inexistente
Provided file to checksum does not exist.
Binary download failed, trying source.
Detected that you have 12 CPU core(s)
Running with 11 threads to speed up the build
Downloading https://nodejs.org/dist/v18.18.2/node-v18.18.2.tar.xz...
Warning: Failed to open the file 
Warning: /home/vinicius_pires/.nvm/.cache/src/node-v18.18.2/node-v18.18.2.tar.x
Warning: z: Permission denied
                                                                            0.0%curl: (23) Failure writing output to destination

Binary download from https://nodejs.org/dist/v18.18.2/node-v18.18.2.tar.xz failed, trying source.
grep: /home/vinicius_pires/.nvm/.cache/src/node-v18.18.2/node-v18.18.2.tar.xz: *Arquivo ou diretório inexistente* (Nonexistent file or directory)
Provided file to checksum does not exist.

使用命令

nvm install 18
尝试下载节点,但当我这样做时,该消息显示在终端上。

尝试用此命令解决

sudo rm /var/lib/apt/lists/* ; sudo rm /var/lib/apt/lists/partial/* ; sudo apt-get clean ; sudo apt-get -f install ; sudo apt-get update 
但没有成功。

node.js terminal nvm apt-get ubuntu-22.04
1个回答
0
投票

我在其他论坛上搜索了答案,发现了与我类似的情况。当我无法使用

curl
安装任何东西时,我使用
sudo snap install curl
安装了
apt-get
。但我发现这个方法没有用,因为显然
curl
不能正常工作。

我在这里找到了答案: curl:(23) 将输出写入目标失败。

基本上解决这个问题的方法就是删除curl并使用apt-get重新安装

sudo snap remove curl
sudo apt-get install curl

这样一切就恢复正常了。

© www.soinside.com 2019 - 2024. All rights reserved.