LoginSignup
16
15

More than 5 years have passed since last update.

Node.jsを複数バージョンインストール[On Windows 10]

Posted at

Windows 10 環境に Node.js の複数バージョンを切り替えて使用する方法はいくつかありますが、私は 「Node Version Manager (nvm) for Windows」を利用した環境にしてみました。インストール記録として残しておきます。

0. 前提条件

  • Windows 10 Pro 1809
  • Node Version Manager (nvm) for Windows

1. nvm for Windows のインストール

Node Version Manager (nvm) for Windows」のインストーラをダウンロードします。
image.png

[v1.1.7 2018/11/10現在の最新]

nvm-setup.zipをダウンロードして展開して、nvm-setup.exeをダブルクリックしてインストール完了です。
※既に Node.js がインストールされている場合、それを nvm for Windows の管理に含めるかを聞いてきます。

インストールの確認は、以下で確認できます。

dos
$ nvm list
No installations recognized.

2.Node.js をインストール

所望のバージョンの Node.js をインストールしていきます。
私は、v4.3.1最新LTS版をインストールしました。

まずは、インストール可能なバージョンを確認します。
どうもv4.3.1は無いようです。
最新LTS版は、v10.15.0でした。

$ nvm list available
|   CURRENT    |     LTS      |  OLD STABLE  | OLD UNSTABLE |
|--------------|--------------|--------------|--------------|
|    11.6.0    |   10.15.0    |   0.12.18    |   0.11.16    |
|    11.5.0    |   10.14.2    |   0.12.17    |   0.11.15    |
|    11.4.0    |   10.14.1    |   0.12.16    |   0.11.14    |
|    11.3.0    |   10.14.0    |   0.12.15    |   0.11.13    |
|    11.2.0    |   10.13.0    |   0.12.14    |   0.11.12    |
|    11.1.0    |    8.15.0    |   0.12.13    |   0.11.11    |
|    11.0.0    |    8.14.1    |   0.12.12    |   0.11.10    |
|   10.12.0    |    8.14.0    |   0.12.11    |    0.11.9    |
|   10.11.0    |    8.13.0    |   0.12.10    |    0.11.8    |
|   10.10.0    |    8.12.0    |    0.12.9    |    0.11.7    |
|    10.9.0    |    8.11.4    |    0.12.8    |    0.11.6    |
|    10.8.0    |    8.11.3    |    0.12.7    |    0.11.5    |
|    10.7.0    |    8.11.2    |    0.12.6    |    0.11.4    |
|    10.6.0    |    8.11.1    |    0.12.5    |    0.11.3    |
|    10.5.0    |    8.11.0    |    0.12.4    |    0.11.2    |
|    10.4.1    |    8.10.0    |    0.12.3    |    0.11.1    |
|    10.4.0    |    8.9.4     |    0.12.2    |    0.11.0    |
|    10.3.0    |    8.9.3     |    0.12.1    |    0.9.12    |
|    10.2.1    |    8.9.2     |    0.12.0    |    0.9.11    |
|    10.2.0    |    8.9.1     |   0.10.48    |    0.9.10    |
This is a partial list. For a complete list, visit https://nodejs.org/download/release

ダメもとでv4.1.3をインストールしてみます。

dos
$ nvm install 4.3.1
Downloading node.js version 4.3.1 (64-bit)...
Complete
Creating C:\Users\hoge\AppData\Roaming\nvm\temp

Downloading npm version 2.14.12... Complete
Installing npm v2.14.12...

Installation complete. If you want to use this version, type

nvm use 4.3.1
$

インストールできました。
以下確認しましたが、問題ないようです。

dos
$ nvm use 4.3.1
Now using node v4.3.1 (64-bit)
$ node --version
v4.3.1
$

引き続き、v10.15.0をインストールします。

dos
$ nvm install 10.15.0
Downloading node.js version 10.15.0 (64-bit)...
Complete
Creating C:\Users\hoge\AppData\Roaming\nvm\temp

Downloading npm version 6.4.1... Complete
Installing npm v6.4.1...

Installation complete. If you want to use this version, type

nvm use 10.15.0
$

v4.3.1と同様に確認します。
問題ないようです。

dos
$ nvm use 10.15.0
Now using node v10.15.0 (64-bit)
$ node --version
v10.15.0
$

以下のコマンドで現在使っているバージョンとインストール済みのバージョンを確認できます。

dos
$ nvm list

  * 10.15.0 (Currently using 64-bit executable)
    4.3.1
$

以上です。

16
15
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
15