Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Required fields*

NodeJS error "EMFILE, too many open files" on Mac OS

For sometime I am having the following error:

Error: EMFILE, too many open files '/Users/blagus/Gallery/Websites/Nicsware/Pills/resources/core/auth.node.js'
 at Object.fs.openSync (fs.js:427:18)
 at Object.fs.readFileSync (fs.js:284:15)
 at Object.Module._extensions..js (module.js:473:44)
 at Module.load (module.js:356:32)
 at Function.Module._load (module.js:312:12)
 at Module.require (module.js:364:17)
 at require (module.js:380:17)
 at instController (/Users/blagus/Gallery/Websites/Nicsware/Pills/engine/mvc.node.js:79:31)
 at init (/Users/blagus/Gallery/Websites/Nicsware/Pills/engine/mvc.node.js:57:8)
 at route (/Users/blagus/Gallery/Websites/Nicsware/Pills/engine/dispatcher.node.js:268:36)

The line of code making the call to this file (mvc.node.js:79) is

 this.currentRoute.class = require( controllerFile )[dispatchClass].bind( this );

(it is a framework I am creating)

As you can see, the file auth.node.js is called by a REQUIRE, so the given solutions with gracefullFS and similar does not fit. Besides, this problem occour MacOS only. In a Ubuntu seems to work just fine.

Any thoughts?

Answer*

Draft saved
Draft discarded
Cancel
1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. Commented Apr 12, 2022 at 19:02

lang-js

AltStyle によって変換されたページ (->オリジナル) /