Home > Software design >  Installing node 16 in Ubuntu 20.04 (WSL) gives me node 14
Installing node 16 in Ubuntu 20.04 (WSL) gives me node 14

Time:12-07

I installed node 16, on Ubuntu 20.04 (WSL on Windows10) using these commands:

curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs

And it gets the right package

Unpacking nodejs (16.13.1-deb-1nodesource1) ...
Setting up nodejs (16.13.1-deb-1nodesource1) ...

But somehow, I get node 14

$ node -v
v14.15.5

I had nodejs installed already before I tried to upgrade to 16 but I am pretty sure the installer removed it.

I tried to remove the package nodejs and installagain , I ran apt autoremove, I checked /etc/apt/sources.list.d/nodesource.list and there is only the node_16.x PPA...

What did I miss? Where is that node 14 coming from?

CodePudding user response:

My bad... Turns out it was emscripten who had installed another NodeJS in its own app folder and was setting that in the env.

I just deleted the node directory in the emsdk folder and it's working.

  • Related