0

I want to use npm but it tells me on every command "npm does not support Node.js v10.19.0" so I want to update my node.js. I performed sudo apt update I tried to install it with sudo apt install nodejs but it tells me the latest version is already installed (but thats not true)

nodejs ist schon die neueste Version (10.19.0~dfsg-3ubuntu1).

Translation: nodejs already is the latest version. I downloaded the latest version 16.13.1 LTS as tar.gz and unpacked the files. I found the commands to use these file are

./configure
make
sudo make install

but where? In the unpacked folder is no folder named cofigure. What am I doing wrong? Thanks for your help and time

1 Answers1

0

The version of most applications available via apt in the LTS Ubuntu distribution repositories are usually not the latest. The reasons for this are answered in the question Why don't the Ubuntu repositories have the latest versions of software?

If you want the latest, you might be better off installing the snap provided by the OpenJS Foundation, with the command:

sudo snap install node --classic

More details here: https://snapcraft.io/install/node/ubuntu

plebbus
  • 66
  • I installed the snap but yet there is no difference. It's still saying "npm does not support Node.js v10.19.0". Do I need to use special commands to call the snap version? – CrackbuddyMethusalem Dec 12 '21 at 10:17
  • Rather than using the snap, you might be better off adding the node repository and installing from there. To remove the snap use the following command: sudo snap remove node Then follow the instructions here: https://askubuntu.com/questions/594656/how-to-install-the-latest-versions-of-nodejs-and-npm – plebbus Dec 17 '21 at 00:22