I have installed Ubuntu Bash on Windows. I already have nodejs
and npm
on my windows machine at C:\\Program Files\\nodejs
. In the bash she
I just read through many threads trying to do this. There is complete documentation for setting up node, nvm and npm in wsl, here: https://docs.microsoft.com/en-us/windows/nodejs/setup-on-wsl2
If you already installed node and npm using the following commands,
sudo apt-get install nodejs
sudo apt-get install npm
NPM will not work. You must first uninstall them using:
sudo apt-get remove nodejs
sudo apt-get remove npm
follow the guide to completely uninstalling here: How can I completely uninstall nodejs, npm and node in Ubuntu 14.04
Then reinstall from the windows guide referenced above. The windows guide has many other useful resources.
The Tldr to install(from Microsoft Docs):
sudo apt-get install curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
nvm install --lts