Installing node.js in WSL 2 (NOTE: Although this tutorial demonstrates WSL 2/Ubuntu, this installation is primarily for Linux) In this tutorial, we will use node version manager or nvm to install and manage node versions. nvm certainly has its advant...

Markdown supported · ⌘↵ to post
Darren Evans
I find nvm in a WSL Linux distro confusing. Firstly, I have nvm for Windows installed. Entering my Ubuntu 20.04 distro and following the install instructions for the Linux version of nvm and then typing whereis nvm, I see the path is a Windows mount at: /mnt/c/Users/seefe/AppData/Roaming/nvm/nvm.exe.
When I printenv in Linux I see
NVM_DIR=/home/seefer/.nvmis pointing at the Linux filesystem version. Very confusing. I also installed gatsby-cli in Windows and Linux and again, it points to the Windows version and typinggatsbyin Linux takes 20 seconds to respond due to slow WSL interop across Windows<->Linux filesystems :/