13
5

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.

Homebrewでnodebrew入れたらハマった

Posted at

nodebrewのセットアップにハマった案件。

nodebrewでnodeのインストールができない

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

はて・・・~/.nodebrewディレクトリが無いだと・・。

解決

Homebrewでインストールした時に

$ brew install nodebrew

:(省略)
==> Caveats
You need to manually run setup_dirs to create directories required by nodebrew:
  /usr/local/opt/nodebrew/bin/nodebrew setup_dirs

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 completions have been installed to:
  /usr/local/share/zsh/site-functions

:(省略)

セットアップの方法がちゃんと書いてあるではないか!!

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

これで無事にnodeを入れることができた。

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

$ nodebrew use v6.10.0
use v6.10.0

$ node -v
v6.10.0
13
5
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
13
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?