Home >Web Front-end >JS Tutorial >How to install Node.js on WSL ubuntu ?
First of all check your ubuntu version by entering the following command: lsb_release-a
Confirm the compatibility of nodejs according to your ubuntu version: here
and then enter following command to download the nodejs setup:
curl -fsSL https://deb.nodesource.com/setup_23.x -o nodesource_setup.sh
for example, if you want to download nodejs 20 replace 23.x by 20.x
Now run the setup by entering the following command:
sudo -E bash nodesource_setup.sh
Once its done you will see > successfully configured repository
then enter below command to install the nodejs:
sudo apt install -y nodejs
Enter node -v to check version and confirm if nodejs is successfully installed.
The above is the detailed content of How to install Node.js on WSL ubuntu ?. For more information, please follow other related articles on the PHP Chinese website!