简体   繁体   中英

Nodejs is not installing by nvm in arch linux

I am in arch linux. I have downloaded nvm . But when i am trying to install node by nvm install node . Shell giving this error

mkdir: cannot create directory ‘/usr/share/nvm/alias’: Permission denied
mkdir: cannot create directory ‘/usr/share/nvm/alias’: Permission denied
mkdir: cannot create directory ‘/usr/share/nvm/alias’: Permission denied
mkdir: cannot create directory ‘/usr/share/nvm/alias’: Permission denied
Downloading and installing node v19.5.0...
mkdir: cannot create directory ‘/usr/share/nvm/.cache’: Permission denied
creating directory /usr/share/nvm/.cache/bin/node-v19.5.0-linux-x64/files failed
Downloading https://nodejs.org/dist/v19.5.0/node-v19.5.0-linux-x64.tar.xz...
Warning: Failed to open the file
Warning: /usr/share/nvm/.cache/bin/node-v19.5.0-linux-x64/node-v19.5.0-linux-x6
Warning: 4.tar.xz: No such file or directory
curl: (23) Failure writing output to destination
Binary download from https://nodejs.org/dist/v19.5.0/node-v19.5.0-linux-x64.tar.xz failed, trying source.
grep: /usr/share/nvm/.cache/bin/node-v19.5.0-linux-x64/node-v19.5.0-linux-x64.tar.xz: No such file or directory
Provided file to checksum does not exist.
Binary download failed, trying source.
mkdir: cannot create directory ‘/usr/share/nvm/.cache’: Permission denied
creating directory /usr/share/nvm/.cache/src/node-v19.5.0/files failed
Downloading https://nodejs.org/dist/v19.5.0/node-v19.5.0.tar.xz...
Warning: Failed to open the file
Warning: /usr/share/nvm/.cache/src/node-v19.5.0/node-v19.5.0.tar.xz: No such
Warning: file or directory
curl: (23) Failure writing output to destination

Binary download from https://nodejs.org/dist/v19.5.0/node-v19.5.0.tar.xz failed, trying source.
grep: /usr/share/nvm/.cache/src/node-v19.5.0/node-v19.5.0.tar.xz: No such file or directory
Provided file to checksum does not exist.```

You'll have to prepend sudo to your command since it is attempting to install node globally in `/usr/share/´.

Try sudo nvm install node and see if that helps. If it doesn't, see who you are issuing the command as with whoami and then check the permissions of /usr/share with ls -l /usr/share to see if it has changed to something non-default by mistake.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM