LoginSignup
8
9

More than 5 years have passed since last update.

nodebrew でnode.jsのバージョンを上げてみる

Posted at

yoをアップデートしようとしたら

✖ Node.js version

Your Node.js version is outdated.

と怒られたのでアップデートしてみる

node.jsの管理にはHomebrewでインストールしたnodebrewを使ってます。

現在のバージョンを確認

$ node -v
v0.11.14

nodebrewでリポジトリにあるバージョンを確認

$ nodebrew ls-remote
           :
           :
v4.4.0    v4.4.1    v4.4.2    v4.4.3    v4.4.4    v4.4.5    v4.4.6    v4.4.7
           :
           :

node.jsのサイトによると最新安定版はv4.4.7だということなので、それをインストール

nodebrew install v4.4.7
           :
           :
           :
           :

インストールまで結構掛かる・・・

バージョンの切り替え

インストールが終わったら切り替える

$ nodebrew use v4.4.7

// 確認
$ node -v
  v4.4.7 <= 変わってる!

npmのバージョンアップ

npmも一緒にあげときましょう

// 確認
$ npm -v
  2.9

$ npm install -g npm

// 再度確認
$ npm -v
  3.10.5 <= 上がってる

これで目的のyoのアップデートも問題なしです。

8
9
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
8
9