在ubuntu24上使用nvm进行node环境安装时,安装所有版本都提示权限错误
Downloading and installing node v14.17.0...
Downloading https://nodejs.org/dist/v14.17.0/node-v14.17.0-linux-x64.tar.xz...
Warning: Failed to create the file
Warning: /home/xx/.nvm/.cache/bin/node-v14.17.0-linux-x64/node-v14.17.0-lin
Warning: ux-x64.tar.xz: Permission denied
curl: (23) Failure writing output to destination
查询nvm的issues后发现有一个相同的issues 其中的解决办法是: 首先使用snap卸载curl
sudo snap remove curl --purge
然后使用apt重新进行安装即可
sudo apt install curl
Tips:
按理说所有使用snap安装的curl都有可能会遇到这个问题,所以不局限于ubuntu24版本
原issues地址:github.com/nvm-sh/nvm/…