LoginSignup
32
18

More than 5 years have passed since last update.

Macにnodejsを入れたときにFailed to create the fileでインストールできない

Posted at

macでnodejsを入れるときにエラー(Failed to create the file)になったさいの対処法です。

環境

maxos 10.14
Homebrew 1.8.6

エラー内容

# brewでnodebrewをインストール
$ brew install nodebrew
# 最新版のnodejsをインストール
$ nodebrew install-binary latest

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

https://nodejs.org/dist/v11.6.0/node-v11.6.0-darwin-x64.tar.gz
はアクセスできる。

原因と対処法

インストール先のディレクトリがないため

mkdir -p ~/.nodebrew/src
でディレクトリを作っておく。

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

できた!

homebrew使っているとこの手のエラーは遭遇したことはないので忘備録としてとっておく。

32
18
1

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
32
18