WSL2 Ubuntu Windows 11: node version reverts to 16 after `nvm use 18` after closing/reopening terminal

14 Views Asked by At

On my Windows 11 machine, using WSL2 and an Ubuntu distro, if I run node -v after launching the terminal (either the standalone terminal or the one integrated into VS Code), it says I'm running version 16.

If I run nvm use 18, it (correctly) switches my Node version to 18.

However, if I close the terminal and re-open it, it reverts to version 16.

I have tried nvm alias default 18, but that doesn't cause v18 to persist. I have also tried closing all my terminals (standalone and VS Code), opening each one at a time, and running nvm alias default, but to no effect.

Is there a way to make my terminals always launch with the node version set to 18?

0

There are 0 best solutions below