LoginSignup
1
0

More than 1 year has passed since last update.

Node.jsのバージョン切り替え(nodebrew)

Last updated at Posted at 2022-06-24

Node.jsのバージョン切り替えに関するメモ

Node.js管理ツール

・nodebrew

その他の管理ツール一覧はheppokofrontendさんの記事が参考になります。
Node.jsのバージョン管理ツールを改めて選定する【2021年】

現在利用中のNodeのバージョンを確認する

$ node -v
v16.14.0

ダウンロード可能なNodeのバージョンを確認する

$nodebrew ls-remote
v0.0.1    v0.0.2    v0.0.3    v0.0.4    v0.0.5    v0.0.6    

v0.1.0    v0.1.1    v0.1.2    v0.1.3    v0.1.4    v0.1.5    v0.1.6    v0.1.7
v0.1.8    v0.1.9    v0.1.10   v0.1.11   v0.1.12   v0.1.13   v0.1.14   v0.1.15
v0.1.16   v0.1.17   v0.1.18   v0.1.19   v0.1.20   v0.1.21   v0.1.22   v0.1.23
v0.1.24   v0.1.25   v0.1.26   v0.1.27   v0.1.28   v0.1.29   v0.1.30   v0.1.31
v0.1.32   v0.1.33   v0.1.90   v0.1.91   v0.1.92   v0.1.93   v0.1.94   v0.1.95
v0.1.96   v0.1.97   v0.1.98   v0.1.99   v0.1.100  v0.1.101  v0.1.102  v0.1.103
v0.1.104  
(以下略)

Nodeのバージョンをダウンロードする

$ nodebrew install v8.9.4 👈バージョンを指定

最新の安定版をインストールする場合は以下
$ nodebrew install-binary stable

ダウンロード済みのNodeのバージョンを確認する

$ nodebrew list
v8.9.4
v10.15.0
v12.16.3
v12.18.3
v16.2.0
v16.14.0

current: v16.14.0  👈現在利用中のバージョン

利用するNodeのバージョンを切り替える

$ nodebrew use v8.9.4 👈 使うバージョンを指定
$ node -v
v8.9.4
1
0
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
1
0