1
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 Version Manager

Posted at
1 / 7

Node.jsのバージョン管理ツール

  • node.jsはバージョン依存度が高いため、バージョン管理ツールが必須です。
  • 主要なものに「nodebrew」「nvm」などがあります。

どちらがおすすめ?

nvmのほうが人気です。
image.png


Cloud9でのNode.jsとnvm

既にプリインストールされています。

whitecat:~/environment $ node -v                                                                                                                                         
v10.19.0
whitecat:~/environment $ nvm --version
0.31.7
whitecat:~/environment $ 

nvmのバージョンアップ

whitecat:~/environment $ cd ~/.nvm/
whitecat:~/.nvm ((v0.31.7)) $ git pull origin master
From https://github.com/creationix/nvm

whitecat:~/.nvm ((73438e3...)) $ source ~/.nvm/nvm.sh
whitecat:~/.nvm ((73438e3...)) $ nvm --version
0.35.3

nvmの設定状況

whitecat:~/environment $ nvm ls
->     v10.19.0
         system
default -> 10 (-> v10.19.0)
node -> stable (-> v10.19.0) (default)
stable -> 10.19 (-> v10.19.0) (default)

Node.jsの最新化

whitecat:~/environment $ nvm install stable --latest-npm
Downloading and installing node v13.12.0...
Now using node v13.12.0 (npm v6.14.4)
whitecat:~/environment $ nvm alias default stable
default -> stable (-> v13.12.0)
whitecat:~/environment $ nvm ls
       v10.19.0
->     v13.12.0
         system
default -> stable (-> v13.12.0)
node -> stable (-> v13.12.0) (default)
stable -> 13.12 (-> v13.12.0) (default)
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?