Node.js is a powerful runtime environment that allows you to run JavaScript on the server side. It is commonly used for building web applications, APIs, and command line tools. In this tutorial, we will show you how to easily install Node.js on WSL (Windows Subsystem for Linux), Mac, or Ubuntu.
Installing Node.js on WSL
If you are using WSL, you can easily install Node.js by following these steps:
-
Open your WSL terminal.
- Update your package index by running the following command:
sudo apt update
- Install Node.js by running the following command:
sudo apt install nodejs
- Verify the installation by checking the Node.js version with the following command:
node -v
You should see the installed version of Node.js displayed in your terminal.
Installing Node.js on Mac
If you are using a Mac, you can easily install Node.js using Homebrew, a popular package manager for macOS. Follow these steps to install Node.js on your Mac:
-
Open your terminal.
- Install Homebrew by running the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
- Update Homebrew and the package index by running the following command:
brew update
- Install Node.js using Homebrew by running the following command:
brew install node
- Verify the installation by checking the Node.js version with the following command:
node -v
You should see the installed version of Node.js displayed in your terminal.
Installing Node.js on Ubuntu
If you are using Ubuntu, you can install Node.js using the package manager. Follow these steps to install Node.js on your Ubuntu machine:
-
Open your terminal.
- Update your package index by running the following command:
sudo apt update
- Install Node.js using the package manager by running the following command:
sudo apt install nodejs
- Verify the installation by checking the Node.js version with the following command:
node -v
You should see the installed version of Node.js displayed in your terminal.
In conclusion, installing Node.js on WSL, Mac, or Ubuntu is a straightforward process that involves using the package manager to install the Node.js runtime environment. By following the steps outlined in this tutorial, you can easily install Node.js and start building applications using JavaScript on your preferred operating system.
Thanks!
Thanks for the video, it would be good if you mention to install latest stable version using: nvm install –lts
Thank you!
Thanks
Thank you so much ! you saved to me ! Greetings from Argentina !
hell this is soo gold, thank you bigtime!
thank you
Thank you!
I've been looking into this for hours and you just did it in 5 seconds!
this is the best tutorial on how to install node on linux
Excellent video, you helped me a lot
I was installing nodejs from apt but I cannot access npm. This video is really helpful because I can access nodejs and npm. Thanks!
Excellent!!!!
You saved my life, Im stucked with "nvm use"
You saved my life. Sort of. I never knew about WSL until 2 hours ago. I'm in the rabbit hole now.
Installing WSL is such a headache, lol
Thanks for sharing Dom. Is it possible to check the node version supported for my system using nvm?