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
Protect Your Passport While Traveling
Information About Yellowjackets, Killer Bees and Wasps – PestWorld
Cpmc Mission Bernal Campus & Orthopedic Institute Photos
Frases para un bendecido domingo: llena tu día con palabras de gratitud y esperanza - Blogfrases
Skycurve Replacement Mat
Amc Near My Location
Breaded Mushrooms
Couchtuner The Office
Craigslist Benton Harbor Michigan
Activities and Experiments to Explore Photosynthesis in the Classroom - Project Learning Tree
Wausau Marketplace
Kostenlose Games: Die besten Free to play Spiele 2024 - Update mit einem legendären Shooter
Mikayla Campinos Videos: A Deep Dive Into The Rising Star
Ucf Event Calendar
Nichole Monskey
Builders Best Do It Center
Troy Athens Cheer Weebly
Local Dog Boarding Kennels Near Me
Grace Caroline Deepfake
Craftology East Peoria Il
Wal-Mart 140 Supercenter Products
Richland Ecampus
Vandymania Com Forums
Beverage Lyons Funeral Home Obituaries
Heart Ring Worth Aj
Rqi.1Stop
Quick Answer: When Is The Zellwood Corn Festival - BikeHike
The Old Way Showtimes Near Regency Theatres Granada Hills
Scream Queens Parents Guide
Del Amo Fashion Center Map
Directions To Nearest T Mobile Store
Vadoc Gtlvisitme App
Tokioof
Roadtoutopiasweepstakes.con
Craigslist Dallastx
ATM Near Me | Find The Nearest ATM Location | ATM Locator NL
Rage Of Harrogath Bugged
Evil Dead Rise (2023) | Film, Trailer, Kritik
Oriellys Tooele
Mars Petcare 2037 American Italian Way Columbia Sc
Hellgirl000
Craigslist Putnam Valley Ny
Puretalkusa.com/Amac
Live Delta Flight Status - FlightAware
Carteret County Busted Paper
Courses In Touch
Linkbuilding uitbesteden
Rocket Lab hiring Integration & Test Engineer I/II in Long Beach, CA | LinkedIn
Studentvue Calexico
War Room Pandemic Rumble
Florida Lottery Powerball Double Play
How to Get a Check Stub From Money Network
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.