Simple Steps for Installing Node.js on WSL, Mac, or Ubuntu

Posted by


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:

  1. Open your WSL terminal.

  2. Update your package index by running the following command:
sudo apt update
  1. Install Node.js by running the following command:
sudo apt install nodejs
  1. 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:

  1. Open your terminal.

  2. Install Homebrew by running the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  1. Update Homebrew and the package index by running the following command:
brew update
  1. Install Node.js using Homebrew by running the following command:
brew install node
  1. 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:

  1. Open your terminal.

  2. Update your package index by running the following command:
sudo apt update
  1. Install Node.js using the package manager by running the following command:
sudo apt install nodejs
  1. 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.

0 0 votes
Article Rating
16 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
@Tek_D-tt2bu
1 month ago

Thanks!

@mostafapapen2628
1 month ago

Thanks for the video, it would be good if you mention to install latest stable version using: nvm install –lts

@neiljb1975
1 month ago

Thank you!

@anonymous12478
1 month ago

Thanks

@juanpanizzi6418
1 month ago

Thank you so much ! you saved to me ! Greetings from Argentina !

@eo333
1 month ago

hell this is soo gold, thank you bigtime!

@iury664
1 month ago

thank you

@Mirzly
1 month ago

Thank you!
I've been looking into this for hours and you just did it in 5 seconds!

@davidbodunrin87
1 month ago

this is the best tutorial on how to install node on linux

@emilianobulaich6504
1 month ago

Excellent video, you helped me a lot

@shiro6718
1 month ago

I was installing nodejs from apt but I cannot access npm. This video is really helpful because I can access nodejs and npm. Thanks!

@josueduran08z
1 month ago

Excellent!!!!

@punaky682
1 month ago

You saved my life, Im stucked with "nvm use"

@SHONNER
1 month ago

You saved my life. Sort of. I never knew about WSL until 2 hours ago. I'm in the rabbit hole now.

@Dexter101x
1 month ago

Installing WSL is such a headache, lol

@neontuts5637
1 month ago

Thanks for sharing Dom. Is it possible to check the node version supported for my system using nvm?