LoginSignup
5
7

More than 5 years have passed since last update.

macOS SierraでNode.jsをインストール

Posted at

環境

  • MacBook Pro(Touch Bar搭載)
  • macOS Sierra(10.12.1)

その前にmacOS SierraにHomebrewをインストール済。

Nodebrewインストール

Node.jsはバージョン管理したいのでNodebrew導入。

$ brew install nodebrew
==> Using the sandbox
==> Downloading https://github.com/hokaccha/nodebrew/archive/v0.9.6.tar.gz
Already downloaded: /Users/xxxxxx/Library/Caches/Homebrew/nodebrew-0.9.6.tar.gz
==> /usr/local/Cellar/nodebrew/0.9.6/bin/nodebrew setup_dirs
==> Caveats
Add path:
  export PATH=$HOME/.nodebrew/current/bin:$PATH

To use Homebrew's directories rather than ~/.nodebrew add to your profile:
  export NODEBREW_ROOT=/usr/local/var/nodebrew

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completion has been installed to:
  /usr/local/share/zsh/site-functions
==> Summary
🍺  /usr/local/Cellar/nodebrew/0.9.6: 8 files, 37.9K, built in 1 second

Node.jsインストール

そのまま最新版Node.js導入。

$ nodebrew install-binary latest
Fetching: https://nodejs.org/dist/v7.2.0/node-v7.2.0-darwin-x64.tar.gz
Warning: Failed to create the file 
Warning: /Users/xxxxxx/.nodebrew/src/v7.2.0/node-v7.2.0-darwin-x64.tar.gz: No 
Warning: such file or directory
                                                                           0.0%
curl: (23) Failed writing body (0 != 941)
download failed: https://nodejs.org/dist/v7.2.0/node-v7.2.0-darwin-x64.tar.gz

おっと、失敗(汗
これが必要でしたか。

$ nodebrew setup
Fetching nodebrew...
Installed nodebrew in $HOME/.nodebrew

========================================
Export a path to nodebrew:

export PATH=$HOME/.nodebrew/current/bin:$PATH
========================================

リトライ。

$ nodebrew install-binary latest
Fetching: https://nodejs.org/dist/v7.2.0/node-v7.2.0-darwin-x64.tar.gz
######################################################################## 100.0%
Installed successfully

上手くいきました。

5
7
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
5
7