简体   繁体   中英

Installing node 16 in Ubuntu 20.04 (WSL) gives me node 14

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?

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.

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