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