search
HomeWeb Front-endFront-end Q&AHow to download a specified version of nodejs

Node.js is a very popular JavaScript running environment and is widely used in server-side development, command line tools, web development and other fields. Since Node.js is constantly updated and iterated, there are some changes and new features in each version. Therefore, sometimes it is necessary to download a specific version of Node.js for specific application scenarios.

This article will introduce how to download the specified version of Node.js.

1. Understand the Node.js version naming rules

Before downloading the Node.js version, we need to understand the Node.js version naming rules. The official version number of Node.js is based on the SemVer (Semantic Version) specification. The format of each version number is MAJOR.MINOR.PATCH, where:

  • MAJOR represents the major version number. Node.js with the same MAJOR version number can be compatible, but may not be backward compatible.
  • MINOR represents a minor version number. Changes to the MINOR version number include new features and bug fixes, and are backward compatible.
  • PATCH represents the patch version number, which only contains bug fixes and is backward compatible.

In addition, Node.js also has some version names that are different from the standard SemVer specification, such as LTS version and the latest stable version.

2. Download the specified version of Node.js through nvm

nvm (Node Version Manager) is a very convenient Node.js version management tool that allows us to easily manage different versions of Node.js. Switch between Node.js. Before using nvm to download the specified version of Node.js, we need to install nvm. Here we take the macOS system as an example. For other operating systems, you can refer to the official documentation of nvm for installation.

  1. Install nvm

Execute the following command in the terminal to install nvm:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash

Note: After installing nvm, you need to restart the terminal to use the nvm command.

  1. View available versions

Execute the following command to view available Node.js versions:

nvm ls-remote

The latest Node.js version will be at the top. If you need to view a specific version of Node.js, you can search through filters, for example, find the v14.18.1 version:

nvm ls-remote | grep 'v14.18.1'
  1. Install the specified version

Execute the following command to install Specified version of Node.js:

nvm install v14.18.1

After the installation is complete, you can view the installed Node.js version through the following command:

nvm ls
  1. Use the specified version

Execute the following command in the terminal to switch to the specified version of Node.js:

nvm use v14.18.1

You can use the following command to verify whether the Node.js version is switched successfully:

node -v

3. Through the official website Download the specified version of Node.js

If you do not want to use nvm to manage the Node.js version, you can also directly download the specified version of Node.js through the official website of Node.js.

  1. Open the official website of Node.js

Enter https://nodejs.org/ in the browser to open the official website of Node.js.

  1. Select the download version

On the home page of the official website, click the "Download" button to enter the download page. On the download page, we can choose from a variety of Node.js versions for different operating systems.

If you need to download a specified version of Node.js, you can find the version we need in the "Previous Releases" tab, click on the corresponding version number to enter the download page.

  1. Download and install Node.js

In the download page, you can choose to download the corresponding version of the Node.js installer for installation. After the installation is complete, you can execute the following command in the terminal to verify whether Node.js is installed successfully:

node -v

4. Summary

This article introduces how to download the specified version of Node.js. Node.js versions can be easily managed using the nvm tool. At the same time, the official Node.js website also provides Node.js installation programs for various operating systems to facilitate users to download and install specified versions of Node.js. No matter which method is used, you need to understand the naming rules of the Node.js version before downloading to ensure that the downloaded version meets our needs.

The above is the detailed content of How to download a specified version of nodejs. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What is useEffect? How do you use it to perform side effects?What is useEffect? How do you use it to perform side effects?Mar 19, 2025 pm 03:58 PM

The article discusses useEffect in React, a hook for managing side effects like data fetching and DOM manipulation in functional components. It explains usage, common side effects, and cleanup to prevent issues like memory leaks.

Explain the concept of lazy loading.Explain the concept of lazy loading.Mar 13, 2025 pm 07:47 PM

Lazy loading delays loading of content until needed, improving web performance and user experience by reducing initial load times and server load.

What are higher-order functions in JavaScript, and how can they be used to write more concise and reusable code?What are higher-order functions in JavaScript, and how can they be used to write more concise and reusable code?Mar 18, 2025 pm 01:44 PM

Higher-order functions in JavaScript enhance code conciseness, reusability, modularity, and performance through abstraction, common patterns, and optimization techniques.

How does currying work in JavaScript, and what are its benefits?How does currying work in JavaScript, and what are its benefits?Mar 18, 2025 pm 01:45 PM

The article discusses currying in JavaScript, a technique transforming multi-argument functions into single-argument function sequences. It explores currying's implementation, benefits like partial application, and practical uses, enhancing code read

How does the React reconciliation algorithm work?How does the React reconciliation algorithm work?Mar 18, 2025 pm 01:58 PM

The article explains React's reconciliation algorithm, which efficiently updates the DOM by comparing Virtual DOM trees. It discusses performance benefits, optimization techniques, and impacts on user experience.Character count: 159

How do you connect React components to the Redux store using connect()?How do you connect React components to the Redux store using connect()?Mar 21, 2025 pm 06:23 PM

Article discusses connecting React components to Redux store using connect(), explaining mapStateToProps, mapDispatchToProps, and performance impacts.

What is useContext? How do you use it to share state between components?What is useContext? How do you use it to share state between components?Mar 19, 2025 pm 03:59 PM

The article explains useContext in React, which simplifies state management by avoiding prop drilling. It discusses benefits like centralized state and performance improvements through reduced re-renders.

How do you prevent default behavior in event handlers?How do you prevent default behavior in event handlers?Mar 19, 2025 pm 04:10 PM

Article discusses preventing default behavior in event handlers using preventDefault() method, its benefits like enhanced user experience, and potential issues like accessibility concerns.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft