LoginSignup
336
157

More than 5 years have passed since last update.

Node.jsのインストールに失敗する時の解決策(No such file or directory)

Posted at

nodebrewを使ってNode.jsのインストールに失敗した時の解決策です。

Node.jsのインストールに失敗

HomebrewでNode.jsをインストールする場合、バージョン管理のできるnodebrewを使った方が便利です。

nodebrewからNode.jsをインストールするのはとても簡単。下のコマンドを実行するだけです。

$ nodebrew install-binary latest

と思ったら、下のようなエラーが出てしまいました。

Fetching: https://nodejs.org/dist/v7.10.0/node-v7.10.0-darwin-x64.tar.gz
Warning: Failed to create the file 
Warning: /Users/whoami/.nodebrew/src/v7.10.0/node-v7.10.0-darwin-x64.ta
Warning: r.gz: No such file or directory

curl: (23) Failed writing body (0 != 941)
download failed: https://nodejs.org/dist/v7.10.0/node-v7.10.0-darwin-x64.tar.gz

No such file or directory(そんなディレクトリはないよ!)と言ってますね。

対処方法

そんなディレクトリを作ってあげましょう。

下記のコマンドを実行して、ディレクトリを作成します。

$ mkdir -p ~/.nodebrew/src

これでOK。

もう一度トライ

それではもう一度。

下のコマンドで、Node.jsをインストール。

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

Installed successfully(インストール成功)となりました。

めでたしめでたし。

336
157
2

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
336
157