21
19

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.

npm install したら "Error: EMFILE, too many open files"

Last updated at Posted at 2013-03-07

エラー

npm ERR! Error: EMFILE, too many open files
npm ERR!     at new Glob (/Users/ore/.nodebrew/node/v0.8.12/lib/node_modules/npm/node_modules/glob/glob.js:105:21)
npm ERR!     at glob (/Users/ore/.nodebrew/node/v0.8.12/lib/node_modules/npm/node_modules/glob/glob.js:57:11)
npm ERR!     at gypfile (/Users/ore/.nodebrew/node/v0.8.12/lib/node_modules/npm/node_modules/read-package-json/read-json.js:129:17)
npm ERR!     at /Users/ore/.nodebrew/node/v0.8.12/lib/node_modules/npm/node_modules/read-package-json/read-json.js:116:40
npm ERR!     at /Users/ore/.nodebrew/node/v0.8.12/lib/node_modules/npm/node_modules/slide/lib/async-map.js:54:35
npm ERR!     at Array.forEach (native)
npm ERR!     at /Users/ore/.nodebrew/node/v0.8.12/lib/node_modules/npm/node_modules/slide/lib/async-map.js:54:11
npm ERR!     at Array.forEach (native)
npm ERR!     at asyncMap (/Users/ore/.nodebrew/node/v0.8.12/lib/node_modules/npm/node_modules/slide/lib/async-map.js:53:8)
npm ERR!     at extras (/Users/ore/.nodebrew/node/v0.8.12/lib/node_modules/npm/node_modules/read-package-json/read-json.js:115:17)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Darwin 12.2.0
npm ERR! command "/Users/ore/.nodebrew/node/v0.8.12/bin/node" "/Users/ore/.nodebrew/current/bin/npm" "install"

/Users/ore/.nodebrew/node/v0.8.12/lib/node_modules/npm/lib/utils/error-handler.js:235
  log.error("cwd", process.cwd())
                           ^
Error: EMFILE, too many open files
    at process.errorHandler (/Users/ore/.nodebrew/node/v0.8.12/lib/node_modules/npm/lib/utils/error-handler.js:235:28)
    at process.EventEmitter.emit (events.js:123:20)

依存モジュールが多いのでファイルディスクリプタの制限を越えたようす

    # 確認
    limit
    # ...
    # > descriptors     256

    # ふやす
    ulimit -n 1024

512にしてもだめで、1024までしたらインストールできるようになった

OSの設定で増やしておく

これだとこのログインセッションでしか有効じゃないみたいなので、OS X ならlaunchd.confで指定しておけばいいらしい

$HOME/.launchd.conf
limit descriptors 1024

と書いておいた。

21
19
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
21
19

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?