Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm -g "whatever" too many open files

I know sometimes you can get the "Too many open files" error by updating or installing big npm packages but right now it is happening to me anytime i try to do something with "-g"

npm -g ls
npm ls -g
npm update -g

even specifically

npm update -g grunt-cli
npm update -g [whatever package]
npm install -g [whatever package]

i'm on a Mac OS X 10.8 Mountain Lion and my ulimit is already set to unlimited

any suggestion?

like image 659
Zerho Avatar asked Feb 20 '14 18:02

Zerho


People also ask

Where can we find error ‘too many open files’?

Where can we find error, ‘Too Many Open Files’? Since Linux has set a maximum open file limit by default, the system has a method for restricting the number of various resources a process can consume. Usually the ‘Too Many Open Files’ error is found on servers with an installed NGINX/httpd web server or a database server (MySQL/MariaDB/PostgreSQL).

What does too many files open mean in Linux terminal?

If you’ve ever seen the “Too many files open” error message in a terminal window or found it in your system logs, it means that the upper limit has been hit, and the process is not being permitted to open any more files. There’s a system-wide limit to the number of open files that Linux can handle.

What does it mean when a process has too many files?

One of these is the number of files a process can have open at once. If you’ve ever seen the “Too many files open” error message in a terminal window or found it in your system logs, it means that the upper limit has been hit, and the process is not being permitted to open any more files.

How many open files have you opened?

The count of open files isn’t just the number of files you’ve opened. Almost everything in the operating system is using file handles. The system-wide maximum number of file handles can be seen with this command. This returns a preposterously large number of 9.2 quintillion. That’s the theoretical system maximum.


1 Answers

Assuming that you are using MacOSX, try to find out what is your limit by doing:
launchctl limit maxfiles

I have a clean install of OSX Maverick and I have:
maxfiles 256 unlimited

If your system does not show that, try to edit/create a /etc/launchd.conf with something like:
limit maxfiles 256 unlimited
** Increase 256 to a higher number if that does not helps. Remember to reboot.

Check out this answer: https://unix.stackexchange.com/questions/108174/how-to-persist-ulimit-settings-in-osx-mavericks

like image 135
marcoseu Avatar answered Oct 31 '22 21:10

marcoseu