Setting up Bash WSL on Windows 10 (npm, nodejs)

npm-install-error-not-foundram-files-nodejs-npm-3-mnt-c-program-files-nodejs

Just run these commands from bash ..

This will install nodejs 14, if you want to install latest or older version of nodejs.. you should change /setup_14.x like /setup_12.x

Install NodeJS on Ubuntu

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt install npm

Run the following commands if you are using WSL on Windows 10 and npm and node do not run and returns error.

PATH="$HOME/bin:$HOME/.local/bin:/usr/bin:$PATH"
source ~/.profile

Setting up Bash as default on vs code

Go to setting and click the page icon on the right top..

Paste the following code in #settings.json to set bash/wsl as default terminal in vs code.

"terminal.integrated.shell.windows": "C:\\Windows\\System32\\bash.exe",

Now you should see bash as default whenever you launch terminal