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?
This worked for me:
ulimit -n 10480
found here
You can solve this problem by increasing the maxfiles
limit:
launchctl limit maxfiles 16384 16384 && ulimit -n 16384
i had this error and the ulimit and launchclt didn't work for me,
this solution from http://yabfog.com/blog/2014/10/22/yosemite-upgrade-changes-open-file-limit worked for me
echo kern.maxfiles=65536 | sudo tee -a /etc/sysctl.conf
echo kern.maxfilesperproc=65536 | sudo tee -a /etc/sysctl.conf
sudo sysctl -w kern.maxfiles=65536
sudo sysctl -w kern.maxfilesperproc=65536
ulimit -n 65536 65536
and then putting the
ulimit -n 65536 65536
into ~/.bashrc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With