LoginSignup
1
0

More than 5 years have passed since last update.

Node.js環境設定備忘録

Posted at

Macを新しくしたのでシリーズ。備忘録です。
nodebrew を使って node を管理しようと思います。

前提: Homebrewがインストールされていること。

Nodebrew をインストール

$ brew install nodebrew

完了したか確認

$ nodebrew -v
nodebrew 0.9.8

PATHを通す(zsh環境用!!)

~/.zshrc
+ export PATH=$HOME/.nodebrew/current/bin:$PATH
source ~/.zshrc

Node.js のインストール

ひとまず、最新版してみます。

$ nodebrew install-binary latest

そうするとエラーが・・・

Fetching: https://nodejs.org/dist/v8.9.3/node-v8.9.3-darwin-x64.tar.gz
Warning: Failed to create the file
Warning: /Users/hogehoge/.nodebrew/src/v8.9.3/node-v8.9.3-darwin-x64.tar.gz
Warning: : No such file or directory
                                                                           0.0%
curl: (23) Failed writing body (0 != 1124)
download failed: https://nodejs.org/dist/v8.9.3/node-v8.9.3-darwin-x64.tar.gz

ディレクトリを作ってあげます。

$ mkdir ~/.nodebrew
$ mkdir ~/.nodebrew/src

再チャレンジして、うまくいきました(^^)

$ nodebrew install-binary latest
$ nodebrew install-binary stable

なんて簡単なんでしょう!

バージョンを指定して確認

$ nodebrew use stable
$ node -v
v8.9.3

1
0
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
1
0