古いバージョンのNode.jsに変更する方法

Ubuntu 10.10でNode.jsのバージョンv0.5.9-preを動かしています。

私はバージョン v0.5.0-pre を使いたいと思っています。

古いバージョンのnodeにロールバックするにはどうしたらいいですか?

*NIX (Linux, OS X, ...)

npm経由でインストール可能な極めてシンプルなNodeバージョンマネージャである nを使用します。

例えば、Node.js v0.10.xに[Atom][2]をビルドさせたいとします。

npm install -g n   # Install n globally
n 0.10.33          # Install and use v0.10.33
Usage:
n                            # Output versions installed
n latest                     # Install or activate the latest node release
n stable                     # Install or activate the latest stable node release
n                   # Install node 
n use  [args ...]   # Execute node  with [args ...]
n bin               # Output bin path for 
n rm            # Remove the given version(s)
n --latest                   # Output the latest node version available
n --stable                   # Output the latest stable node version available
n ls                         # Output the versions of node available

 

ウィンドウズ

nvm][4]のようなものですが、Windows用です。インストーラー]5をダウンロードして実行してください。

nvm install v0.10.33         # Install v0.10.33
nvm use v0.10.33             # Use v0.10.33
Usage:
nvm install [version]        # Download and install [version]
nvm uninstall [version]      # Uninstall [version]
nvm use [version]            # Switch to use [version]
nvm list                     # List installed versions

[2]: https://github.com/atom/atom [3]: https://github.com/coreybutler/nvm-windows [4]: https://github.com/creationix/nvm

解説 (17)
ソリューション

一つの方法は、NVM(Node Version Manager)を使うことです。

以下のコマンドでnvmを取得します。

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash

https://github.com/creationix/nvm で見つけることができます。

複数のバージョンのnodeを簡単にインストール、管理することができます。ここでは、ヘルプからのスニペットを紹介します。

Usage:
nvm install        Download and install a 
nvm use            Modify PATH to use 
nvm ls                      List versions (installed versions are blue)
解説 (8)

Nodeの複数のバージョンを管理するためのもう一つの良いライブラリは、N: https://github.com/visionmedia/n です。

解説 (1)