Help us understand the problem. What is going on with this article?

nodeのバージョンをnで管理する

More than 3 years have passed since last update.

node.jsのバージョン管理はnvmがよく知られていますが、npmパッケージのnも使えます。
https://github.com/tj/n

前提

環境はmac前提です。

インストール

まず、node.jsがインストールされていなければ、homebrewでインストールします。

brew install node

次にnpmでnをインストール

npm install -g n

nを使ってみる

バージョンの一覧表示

☁  ~  n list

    0.0.1
    0.0.2
省略
    5.7.1
    5.8.0
  ο 5.9.0

☁  ~

最新バージョンへ切替え

☁  ~  n latest
☁  ~  node -v
v5.9.0
☁  ~

特定のバージョンへ切替え

☁  ~  n 5.7.1

     install : node-v5.7.1
       mkdir : /usr/local/n/versions/node/5.7.1
       fetch : https://nodejs.org/dist/v5.7.1/node-v5.7.1-darwin-x64.tar.gz
######################################################################## 100.0%
   installed : v5.7.1

☁  ~  node -v
v5.7.1
☁  ~

しめ

楽ちんですね。
快適なnodeライフを。

bigplants
関心事はDevOps, k8s, docker, AWS, GCP
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした