Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: spawn EMFILE #10

Closed
tiagoporto opened this issue Feb 4, 2014 · 20 comments
Closed

Error: spawn EMFILE #10

tiagoporto opened this issue Feb 4, 2014 · 20 comments

Comments

@tiagoporto
Copy link

What is this error?

child_process.js:935
    throw errnoException(process._errno, 'spawn');
          ^
Error: spawn EMFILE
    at errnoException (child_process.js:988:11)
    at ChildProcess.spawn (child_process.js:935:11)
    at exports.spawn (child_process.js:723:9)
    at Imagemin._optimizePng (/Volumes/DEVEAD/WAMP/www/moodle/theme/numeramento/node_modules/gulp-imagemin/node_modules/image-min/imagemin.js:151:12)
    at Imagemin.optimize (/Volumes/DEVEAD/WAMP/www/moodle/theme/numeramento/node_modules/gulp-imagemin/node_modules/image-min/imagemin.js:63:26)
    at module.exports (/Volumes/DEVEAD/WAMP/www/moodle/theme/numeramento/node_modules/gulp-imagemin/node_modules/image-min/imagemin.js:189:21)
    at /Volumes/DEVEAD/WAMP/www/moodle/theme/numeramento/node_modules/gulp-imagemin/index.js:38:5
    at Object.oncomplete (fs.js:107:15)
@lucacri
Copy link

lucacri commented Feb 12, 2014

Same here, on OSX

@codylindley
Copy link

child_process.js:927
throw errnoException(process._errno, 'spawn');

same here, worked on work osx laptop but not one at home.

@tiagoporto
Copy link
Author

I'm using mac OSX Mavericks

@ErwanGuillon
Copy link

Same error here.

It seems that too many process are opened. But I'm not an expert in node so ...

BTW I'm on Mavericks if it matters

@ErwanGuillon
Copy link

I found some infos but don't know how to fix ...

http://www.runtime-era.com/2012/10/quick-and-dirty-nodejs-exec-limit-queue.html

@sindresorhus
Copy link
Owner

It's like the second result on Google when searching for the error message:
gruntjs/grunt#788 (comment)

Increase your ulimit.

@ErwanGuillon
Copy link

It's the first thing I tried and it doesn't work...

If you look at the issue you linked, it's the same for others. Increase ulimit doesn't work for everyone.

@sindresorhus sindresorhus reopened this Feb 15, 2014
@fyockm
Copy link

fyockm commented Feb 16, 2014

👍 Setting ulimit did not work for me either. OSX Mav as well. Is there some way to throttle imagemin and limit to a certain number of open file descriptors?

@eightyfive
Copy link

This did work for me (Mac OS X):

ulimit -S -n 2048 # or whatever number you choose

(source superuser.com)

@liperuf
Copy link

liperuf commented Mar 22, 2014

ulimit worked for me. OSX Mavericks. Im happy again.

@pascaloliv
Copy link

@8y5 : This fix work perfectly on OSX Mavericks. Thank you.
👍 ulimit -S -n 2048

@gilesbutler
Copy link

ulimit -S -n 2048 works for me but it's not permanent, every time I quit Terminal I get the Error: spawn EMFILE again. Is there anyway to make it a permanent change?

@kevva
Copy link
Contributor

kevva commented May 16, 2014

@gilesbutler
Copy link

Thanks for the link @kevva. I tried everything they suggested but couldn't get it working, I even bought the app Lingon3 which they mention and that didn't work.

In the end it was fairly simple, I just added the command to the bottom of my zhsconfig and it works fine now.

@nicolazj
Copy link

ulimit -S -n 2048 # work for me ,thanks!

@ouzhenkun
Copy link

add "ulimit -S -n 2048" to ~/.bash_profile

@BerkeleyTrue
Copy link

ulimit -S -n 2048 # worked!

darthmall added a commit to darthmall/dotfiles that referenced this issue Nov 19, 2014
Increase the maximum number of open file descriptors to 2048 to deal with gulp
issues: sindresorhus/gulp-imagemin#10. Prepend
node_modules/.bin to PATH for easier use of project-specific node modules.
@helena-sopra
Copy link

ulimit -S -n 2048 #worked for me too 👍 :)

@oluul
Copy link

oluul commented Aug 6, 2015

ulimit -S -n 8196 # worked!

@marek1
Copy link

marek1 commented Oct 11, 2015

ulimit -S -n 2048 worked . thanks.

darthmall added a commit to darthmall/dotfiles that referenced this issue Nov 11, 2018
Increase the maximum number of open file descriptors to 2048 to deal with gulp
issues: sindresorhus/gulp-imagemin#10. Prepend
node_modules/.bin to PATH for easier use of project-specific node modules.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests