After i key in curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - in my WSL terminal, however nothing happens. No installation done.
I did try using sudo apt update. But I cannot connect to ubuntu server. Thus, I am trying use PPA method.
How should I do , so I can install node.js in my WSL
Do not try and use apt
to install node, it is outdated and you will run into problems.
The only clean trouble free install when setting up wsl that I use is:
sudo apt-get install curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
command -v nvm
nvm install --lts
Use NVM (Node Version Manager) to install and use any other node versions you wish.
Example: NVM use 16
NVM will start node version 16.
When you install NVM, it will list all of the commands you can use.