node.js – How to install npm and node on xubuntu jammy version?

I am trying to install node and npm on my laptop. I’m using xubuntu jammy version as my OS. I tried following the instructions but whenever I try to install node, this error seems to pop up whenever I try to install version 22 and the latest version of node. What should I do?enter image description here

I followed all the instructions given in the website of node.js. Unfortunately, I kept receiving the same error.

boydie@Boydie-PC:~$ nvm install 22
Downloading and installing node v22.19.0...
Downloading https://nodejs.org/dist/v22.19.0/node-v22.19.0-linux-x64.tar.xz...
##O#-  #                                                                                                             Warning: Failed to open the file 
Warning: /home/boydie/.nvm/.cache/bin/node-v22.19.0-linux-x64/node-v22.19.0-linux-x64.tar.xz: Permission denied
curl: (23) client returned ERROR on write of 1360 bytes

download from https://nodejs.org/dist/v22.19.0/node-v22.19.0-linux-x64.tar.xz failed
grep: /home/boydie/.nvm/.cache/bin/node-v22.19.0-linux-x64/node-v22.19.0-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/v22.19.0/node-v22.19.0.tar.xz...
#=#=- #   #                                                                                                          Warning: Failed to open the file /home/boydie/.nvm/.cache/src/node-v22.19.0/node-v22.19.0.tar.xz: Permission denied
curl: (23) client returned ERROR on write of 1360 bytes

download from https://nodejs.org/dist/v22.19.0/node-v22.19.0.tar.xz failed
grep: /home/boydie/.nvm/.cache/src/node-v22.19.0/node-v22.19.0.tar.xz: No such file or directory
Provided file to checksum does not exist.

Read more here: Source link