derbyjs / derby-examples

Example applications for the Derby framework
http://derbyjs.com/
283 stars 74 forks source link

Error: EMFILE #52

Closed codingisacopingstrategy closed 9 years ago

codingisacopingstrategy commented 9 years ago

Just a heads up,

running node server.js in the root folder, on OS X 10.10 gives the following error:

~/derby-examples/node_modules/derby-starter/lib/index.js:16
      if (err) throw err;
                     ^
Error: EMFILE, open '~/derby-examples/node_modules/derby/node_modules/racer/package.json'

This problem is pretty well documented online: it has to do with the fact that node runs into the OS’ limit on the maximum number of files opened simultanously. See for instance https://github.com/substack/node-browserify/issues/431

You can work around it by typing ulimit -n 2560 into your terminal before launching the application, @karl suggests putting such a line in the ~/.bash_profile file.

The problem disappears if you try run just one of the examples at a time. Not sure if this problem requires fixing because it might be quite complex to do so—and it doesn’t seem very useful to open up all the examples at the same time anyway…

Cheers,

codingisacopingstrategy commented 9 years ago

So the easiest solution might be to remove the root server.js file? Or is it necessary for testing?

UPDATE: I see you use it for serving

codingisacopingstrategy commented 9 years ago

Tried this on another computer with 10.9.5 (node 0.10.33), same problem

kreegr commented 9 years ago

+1 Same issue

enjalot commented 9 years ago

added this tip to the README, this is a general problem with OS X being too conservative with its ulimit, with a big enough project you will run into this limit anyway.

jritsema commented 9 years ago

For me, this went away after upgrading node from v0.10 to v0.12