How to install Node.js on Linux (2024)

Linux

How to install Node.js on Linux (1)

Your changes have been saved

Email is sent

Email has already been sent

Please verify your email address.

You’ve reached your account maximum for followed topics.

Manage Your List

Link copied to clipboard

Sign in to your XDA account

How to install Node.js on Linux (2)

Node.js is one of the most popular tools used by developers. It's cross-platform, which means it is also available on great Linux distributions like Ubuntu. Unfortunately, Node.js isn't installed by default on Linux, so if you're hoping to use the open-source JavaScript runtime environment on your system, there are a few extra steps that you're going to have to take.

Using the package manager

How to install Node.js on Linux (3)

For most beginners, the easiest way to install Node.js is to use the package manager and the terminal because it's available through the default repositories on Linux. This might not be the latest version, but don't worry since it'll still be stable, and you don't have to enter extra code to grab it. There are various commands depending on which Linux flavor you're using:

  • For Arch Linux, use: sudo pacman -S nodejs npm
  • For Debian, Ubuntu, or Linux Mint, use the command: sudo apt-get install nodejs npm
  • For REHL, CentOS, AlmaLinux, and Rocky Linux, first, enable EPEL with the command sudo dnf install epel-release. Then, run the command sudo dnf install nodejs npm.
  • On Fedora, use: sudo dnf install nodejs npm

If you want to see if Node is installed properly, you can run the command node -v or node --version.

If you're still having issues, you can follow the steps on the Node.js website for your distribution. We picked some of the most popular distributions, as seen above, but there are many others.

Using NVM

A better way to install Node.js is by using Node Version Manager (NVM). This is a bash script that will be run through the terminal once you open it and allows you to use and manage multiple Node.js versions and switch between them. If you opt to use this method, there's a chance you'll run into fewer permission issues, so it's worth using if you don't mind a few extra steps.

  1. If Curl is not installed, run the command: sudo apt install curl
  2. Now, run: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
    How to install Node.js on Linux (4)
  3. Restart your terminal.
  4. Confirm if NVM is installed with: command -v nvm
    How to install Node.js on Linux (5)
  5. Run this command to see all Nodejs versions: nvm ls-remote
    How to install Node.js on Linux (6)
  6. Choose the version you want to install: We suggest the latest version. The command will be nvm install node to grab the latest version.
    How to install Node.js on Linux (7)
  7. If you want a legacy version, use the command nvm install v9.3.0, and replace the version number with the one you want.

Once you install, you can check to see the installed Node versions with the command nvm list. You also can check the installed version with node -v or node --version. If you want to run a specific node version, use the command nvm run node v17.0.0, replacing v17.0.0 with the actual version. If you want to set a specific version of node as default, meanwhile, use the command nvm alias default v18.7.0.

Just one way to develop on Linux

Using Node.js is just one thing that we suggest checking out on Ubuntu. Many other developer tools run on the operating system. For example, you might want to use AWS CLI if you're working on DevOps. You might also want to use tools like Nginx or MongoDB for web serving and managing document databases. Even a tool like Apache is useful. As you can tell, Ubuntu is the place to be for development, and there are nearly endless possibilities.

Your changes have been saved

Email is sent

Email has already been sent

Please verify your email address.

You’ve reached your account maximum for followed topics.

Manage Your List

Follow

Followed

Follow with Notifications

Follow

Unfollow

Readers like you help support XDA. When you make a purchase using links on our site, we may earn an affiliate commission. Read More.

How to install Node.js on Linux (2024)
Top Articles
Ending a Friendship
How Much Does a Vacation Cost? The Average Cost of 12 Amazing Travel Destinations — Next Vacay
Rosy Boa Snake — Turtle Bay
Victor Spizzirri Linkedin
Tabc On The Fly Final Exam Answers
Arkansas Gazette Sudoku
Devotion Showtimes Near Mjr Universal Grand Cinema 16
Encore Atlanta Cheer Competition
Pj Ferry Schedule
What's Wrong with the Chevrolet Tahoe?
Vocabulario A Level 2 Pp 36 40 Answers Key
California Department of Public Health
24 Hour Walmart Detroit Mi
6813472639
Maplestar Kemono
Love In The Air Ep 9 Eng Sub Dailymotion
How Much Are Tb Tests At Cvs
The Grand Canyon main water line has broken dozens of times. Why is it getting a major fix only now?
Carson Municipal Code
623-250-6295
Craigslist West Valley
Gia_Divine
Kamzz Llc
Samantha Aufderheide
Poe Str Stacking
Purdue 247 Football
Miltank Gamepress
Surplus property Definition: 397 Samples | Law Insider
A Christmas Horse - Alison Senxation
What Is a Yurt Tent?
Pixel Combat Unblocked
1636 Pokemon Fire Red U Squirrels Download
2004 Honda Odyssey Firing Order
Penn State Service Management
Ringcentral Background
Ugly Daughter From Grown Ups
Rund um die SIM-Karte | ALDI TALK
Kokomo Mugshots Busted
Tamilrockers Movies 2023 Download
Indiana Immediate Care.webpay.md
Prima Healthcare Columbiana Ohio
Hotels Near New Life Plastic Surgery
Shoreone Insurance A.m. Best Rating
Restored Republic December 9 2022
Mid America Clinical Labs Appointments
Mississippi weather man flees studio during tornado - video
Florida Lottery Claim Appointment
Tfn Powerschool
Reli Stocktwits
Kate Spade Outlet Altoona
Verilife Williamsport Reviews
How to Choose Where to Study Abroad
Latest Posts
Article information

Author: Pres. Lawanda Wiegand

Last Updated:

Views: 6450

Rating: 4 / 5 (71 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Pres. Lawanda Wiegand

Birthday: 1993-01-10

Address: Suite 391 6963 Ullrich Shore, Bellefort, WI 01350-7893

Phone: +6806610432415

Job: Dynamic Manufacturing Assistant

Hobby: amateur radio, Taekwondo, Wood carving, Parkour, Skateboarding, Running, Rafting

Introduction: My name is Pres. Lawanda Wiegand, I am a inquisitive, helpful, glamorous, cheerful, open, clever, innocent person who loves writing and wants to share my knowledge and understanding with you.