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
Master Top 10 Chart Patterns For Successful Stock Trading
[Solved] Almost 90% of India’s Foreign trade by volume and 70%
Design215 Word Pattern Finder
Enrique Espinosa Melendez Obituary
Beacon Schnider
Yi Asian Chinese Union
Western Razor David Angelo Net Worth
Brenna Percy Reddit
Spelunking The Den Wow
Richmond Va Craigslist Com
Ella Eats
Blue Beetle Showtimes Near Regal Swamp Fox
Trini Sandwich Crossword Clue
Kinkos Whittier
Unit 33 Quiz Listening Comprehension
Best Nail Salon Rome Ga
Michigan cannot fire coach Sherrone Moore for cause for known NCAA violations in sign-stealing case
Lancasterfire Live Incidents
Forum Phun Extra
Aps Day Spa Evesham
Bjerrum difference plots - Big Chemical Encyclopedia
Craigslistodessa
Bellin Patient Portal
800-695-2780
Account Now Login In
Jailfunds Send Message
How to Use Craigslist (with Pictures) - wikiHow
Motor Mounts
Laveen Modern Dentistry And Orthodontics Laveen Village Az
Mark Ronchetti Daughters
La Qua Brothers Funeral Home
Word Trip Level 359
Teenage Jobs Hiring Immediately
Family Fare Ad Allendale Mi
Restored Republic December 9 2022
Labyrinth enchantment | PoE Wiki
Craigslist Ludington Michigan
World Social Protection Report 2024-26: Universal social protection for climate action and a just transition
Weather In Allentown-Bethlehem-Easton Metropolitan Area 10 Days
Kenner And Stevens Funeral Home
Panolian Batesville Ms Obituaries 2022
Peace Sign Drawing Reference
Zom 100 Mbti
Secrets Exposed: How to Test for Mold Exposure in Your Blood!
Big Brother 23: Wiki, Vote, Cast, Release Date, Contestants, Winner, Elimination
18443168434
Game Akin To Bingo Nyt
Coleman Funeral Home Olive Branch Ms Obituaries
Maurices Thanks Crossword Clue
Hcs Smartfind
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.