Quantcast
Channel: Node.jsタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 8691

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

$
0
0

環境

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

Viewing all articles
Browse latest Browse all 8691

Trending Articles