How to Update Node.js and NPM to the Latest Version? - GeeksforGeeks (2024)

Last Updated : 04 Sep, 2024

Summarize

Comments

Improve

Updating Node.js and NPM to the latest version ensures the newest features, performance improvements, and security updates. This article will guide you through the steps to update Node.js and npm to the latest version on various operating systems, including Windows, macOS, and Linux.

To update Node and NPM to latest versions we can use various methods like nvm (node version manager), node.js windows installer, npm and homebrew for macOS.

These methods are discussed below in detail.

Table of Content

  • Using NVM
  • Using Node.js Installer on Windows and macOS
  • Using Homebrew on macOS

Check the Installed node version:

node -v

How to Update Node.js and NPM to the Latest Version? - GeeksforGeeks (1)

current installed version

Keeping your skills in Node.js and npm up-to-date is crucial for leveraging the latest features, security enhancements, and performance improvements in your development projects. This comprehensive course on Full-Stack Node.js will guide you through the essential techniques and practices for working with Node.js and npm, covering everything from basic concepts to advanced functionalities.

Using NVM

Step 1: Install NVM on your system, and verify nvm installation

nvm -v

Step 2: Use the following command to install and update Node to the latest version.

nvm install node

How to Update Node.js and NPM to the Latest Version? - GeeksforGeeks (2)

With the above command the compaitible NPM version will be automatically installed (e.g. npm v10 with node v22)

Step 3: After isntalling run this command to use the version mentioned in above response (v22 for now).

nvm use 22 

Using NVM you can easily use any version of node if required

  • Check the list of available Node.js versions in the system using the following command.
nvm list 
  • To use the desired version, use the following command:
nvm use <version>

How to Update Node.js and NPM to the Latest Version? - GeeksforGeeks (3)

Using Node.js Installer on Windows and macOS

Follow these steps to install Node.js on Windows using the Nodejs Installer.

Step 1: Download Installer by Visiting Node.js official website .

Step 2: Run Installer by Opening the downloaded installer. Follow the on-screen instructions to complete the installation.

Step 3: Verify Installation

node -v

Update npm using NPM

Step 4: use below npm command to upgrade npm to latest

npm install -g npm@latest

Step 5: Verify latest Installation update

npm -v

Using Homebrew on macOS

Step 1: Install Homebrew by Visiting brew.sh and follow the installation instructions.

Step 2: brew update

brew update

Step 3: Install Node.js

brew install node

Step 4: Update Node.js

brew upgrade node

Step 5: Verify latest Installation update

node -v

Also Read

JavaScript is best known for web page development but is also used in various non-browser environments. You can learn JavaScript from the ground up by following this JavaScript Tutorial and JavaScript Examples .



Please Login to comment...

How to Update Node.js and NPM to the Latest Version? - GeeksforGeeks (2024)
Top Articles
Enabling TLS 1.2 on web browsers
Enabling TLS 1.2 in Microsoft Edge
Craigslist Livingston Montana
Fan Van Ari Alectra
Login Page
What happened to Lori Petty? What is she doing today? Wiki
From Algeria to Uzbekistan-These Are the Top Baby Names Around the World
Fully Enclosed IP20 Interface Modules To Ensure Safety In Industrial Environment
Triumph Speed Twin 2025 e Speed Twin RS, nelle concessionarie da gennaio 2025 - News - Moto.it
Southeast Iowa Buy Sell Trade
Craigslist Vermillion South Dakota
Mr Tire Rockland Maine
Steve Strange - From Punk To New Romantic
Cars For Sale Tampa Fl Craigslist
World Cup Soccer Wiki
DIN 41612 - FCI - PDF Catalogs | Technical Documentation
Hallelu-JaH - Psalm 119 - inleiding
Craigslist Heavy Equipment Knoxville Tennessee
Aldi Bruce B Downs
Espn Horse Racing Results
Toothio Login
Yayo - RimWorld Wiki
Publix Coral Way And 147
Renfield Showtimes Near Marquee Cinemas - Wakefield 12
Donald Trump Assassination Gold Coin JD Vance USA Flag President FIGHT CIA FBI • $11.73
Royal Caribbean Luggage Tags Pending
Puerto Rico Pictures and Facts
Orangetheory Northville Michigan
What Are Digital Kitchens & How Can They Work for Foodservice
The 50 Best Albums of 2023
拿到绿卡后一亩三分地
D3 Boards
How to Draw a Sailboat: 7 Steps (with Pictures) - wikiHow
Saybyebugs At Walmart
Xxn Abbreviation List 2023
062203010
Man Stuff Idaho
Electric Toothbrush Feature Crossword
Chathuram Movie Download
Pekin Soccer Tournament
Frigidaire Fdsh450Laf Installation Manual
Mitchell Kronish Obituary
Bekkenpijn: oorzaken en symptomen van pijn in het bekken
Greg Steube Height
Crigslist Tucson
Dayton Overdrive
Sams Gas Price San Angelo
Gummy Bear Hoco Proposal
King Fields Mortuary
Vt Craiglist
Latest Posts
Article information

Author: Reed Wilderman

Last Updated:

Views: 5666

Rating: 4.1 / 5 (72 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Reed Wilderman

Birthday: 1992-06-14

Address: 998 Estell Village, Lake Oscarberg, SD 48713-6877

Phone: +21813267449721

Job: Technology Engineer

Hobby: Swimming, Do it yourself, Beekeeping, Lapidary, Cosplaying, Hiking, Graffiti

Introduction: My name is Reed Wilderman, I am a faithful, bright, lucky, adventurous, lively, rich, vast person who loves writing and wants to share my knowledge and understanding with you.