0
2

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 5 years have passed since last update.

【Mac】Node.jsインストール by Homebrew

Posted at

環境

MacOS High Sierra 10.13.3

手順

Homebrewインストール

・インストール

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

※エラーになる場合は以下を実行してから行うと良い。

$ sudo chown -R $(whoami) $(brew --prefix)/*

・インストール確認

$ brew help

nodebrewインストール

・インストール

$ brew install nodebrew

・パスを通す

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

$ source ~/.bash_profile

・インストール確認(バージョンが表示されればOK)

$ nodebrew -v

Node.jsインストール

・ディレクトリを作成

$ mkdir -p ~/.nodebrew/src

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

nodebrew ls-remote

・インストール
 - バージョン指定でインストール

$ nodebrew install-binary {version} 

 - 最新バージョンをインストール

$ nodebrew install-binary latest

・インストールしたバージョンを確認

$ nodebrew ls

・有効化

$ nodebrew use {version}

・npmバージョンを確認

$ npm -v
0
2
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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?