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
2 months ago

Thanks!

@mostafapapen2628
2 months ago

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

@neiljb1975
2 months ago

Thank you!

@anonymous12478
2 months ago

Thanks

@juanpanizzi6418
2 months ago

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

@eo333
2 months ago

hell this is soo gold, thank you bigtime!

@iury664
2 months ago

thank you

@Mirzly
2 months ago

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

@davidbodunrin87
2 months ago

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

@emilianobulaich6504
2 months ago

Excellent video, you helped me a lot

@shiro6718
2 months 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
2 months ago

Excellent!!!!

@punaky682
2 months ago

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

@SHONNER
2 months ago

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

@Dexter101x
2 months ago

Installing WSL is such a headache, lol

@neontuts5637
2 months ago

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