Ubuntu nvm 安装node curl 报错

Ubuntu nvm 安装node curl 报错

本文写于2023.01.16

问题描述

使用 nvm install v19.4.0 安装 node 报错:

Downloading and installing node v19.4.0...
Downloading https://nodejs.org/dist/v19.4.0/node-v19.4.0-linux-x64.tar.xz...
Warning: Failed to open the file                                               
Warning: /home/wang/.nvm/.cache/bin/node-v19.4.0-linux-x64/node-v19.4.0-linux-x
Warning: 64.tar.xz: Permission denied
curl: (23) Failure writing output to destination

Binary download from https://nodejs.org/dist/v19.4.0/node-v19.4.0-linux-x64.tar.xz failed, trying source.
grep: /home/wang/.nvm/.cache/bin/node-v19.4.0-linux-x64/node-v19.4.0-linux-x64.tar.xz: 没有那个文件或目录
Provided file to checksum does not exist.
Binary download failed, trying source.
Downloading https://nodejs.org/dist/v19.4.0/node-v19.4.0.tar.xz...
Warning: Failed to open the file                                               
Warning: /home/wang/.nvm/.cache/src/node-v19.4.0/node-v19.4.0.tar.xz: 
Warning: Permission denied
curl: (23) Failure writing output to destination

Binary download from https://nodejs.org/dist/v19.4.0/node-v19.4.0.tar.xz failed, trying source.
grep: /home/wang/.nvm/.cache/src/node-v19.4.0/node-v19.4.0.tar.xz: 没有那个文件或目录
Provided file to checksum does not exist.

解决思路

观察报错信息,发现下载安装包时就报错了,错误信息为 curl: (23) Failure writing output to destination

Snipaste_2023-01-17_09-21-19.png

出现这个错误,首先想到我的 curl 是通过 snap 安装的,那么卸载使用apt重装试试。

解决方案

确认一下你的curl是不是用snap安装的:

sudo snap list | grep curl

有输出,则为snap安装,则卸载:

sudo snap remove curl

然后用apt重新安装:

sudo apt install curl

最后重新运行安装命令

nvm install v19.4.0
  • 5
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值