乐闻世界logo
搜索文章和话题

How to install older version of node.js on Windows?

1个答案

1

In Windows, installing older versions of Node.js can be achieved through multiple methods, but the most common and recommended approach is to use Node Version Manager (nvm) for Windows. It is a convenient tool that allows you to install and manage multiple Node.js versions on the same machine. Here are the detailed steps:

Step 1: Install NVM for Windows

  1. Visit the GitHub repository for NVM for Windows.
  2. Download the latest installer, typically named nvm-setup.zip.
  3. Extract the file and run the installer. During installation, you can choose the installation location and other configuration options.
  4. After installation, restart the Command Prompt to ensure NVM commands are available.

Step 2: Use NVM to Install a Specific Version of Node.js

  1. Open the Command Prompt or PowerShell.
  2. First, use the nvm list available command to view available Node.js versions.
  3. Install a specific version of Node.js using NVM. For example, to install Node.js version 10.15.3, run:
    shell

nvm install 10.15.3

shell
4. After installation, switch to the newly installed version by running:

nvm use 10.15.3

shell
### Step 3: Verify Installation 1. Check the currently used Node.js version by entering:

node -v

shell
This should display the installed version, such as `v10.15.3`. ### Example Suppose you need to use Node.js version 8.9.4 in one of your projects, as it is required by the project dependencies. You would execute: ```bash nvm install 8.9.4 nvm use 8.9.4 node -v

This ensures your Windows machine is configured with the specific Node.js version, aligning your development environment with project requirements.

Using NVM for Windows to manage multiple Node.js versions significantly enhances development flexibility and efficiency, especially when working with multiple projects that require different Node.js versions.

2024年6月29日 12:07 回复

你的答案