0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

node.jsのインストール、バージョンアップの方法

Posted at

今回は以下の記事を参考にさせていただきました。
nodebrewで手軽にnode.jsバージョンアップ&バージョン切り替え
node.jsのバージョンアップ、バージョン切り替え

はじめに

node.jsはnvm(Node Version Manager)もしくはnodeblewでインストール、アップデートができます。
nvmはbash環境、nodebrewはzsh、bash両方で使えるので今回は使い勝手の良いnodebrewで説明をしていきたいと思います

nodebrewの使い方

1. nodebrewインストール

$ curl -L git.io/nodebrew | perl - setup

.zshrc.bashrcに追記

$ echo 'export PATH="$HOME/.nodebrew/current/bin:$PATH"' >> ~/.zshrc

   or

$ echo 'export PATH="$HOME/.nodebrew/current/bin:$PATH"' >> ~/.bashrc

読み込ませる

$ source ~/.zshrc

 or

$ source ~/.bashrc

2. 使い方

インストール可能なバージョンを確認

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

node.jsのインストール

$ nodebrew install-binary v15.13.0 
Fetching: https://nodejs.org/dist/v15.13.0/node-v15.13.0-darwin-x64.tar.gz
##################################################################################################################################### 100.0%
Installed successfully

バージョンの確認

$ nodebrew ls
v15.13.0

current: none

バージョンの切り替え

$ nodebrew use v15.13.0
use v15.13.0

$ nodebrew ls          
v15.13.0

current: v15.13.0

以上になります。

参照

0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?