I'm trying to run the npm install bitgo command but getting following error on the terminal,
npm ERR! code EMFILE
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno EMFILE
npm ERR! spawn git EMFILE
npm ERR! A complete log of this run can be found in:
npm ERR! /home/root/.npm/_logs/2021-02-10T04_10_05_236Z-debug.log
You can check the complete log from here: https://textbin.cc/raw/MRAdqetnCx
I tried npm install and git is already installed. When i run git ---version it returns git version 2.24.1
Also tried npm install js-beautify@1.6.14
node.js version: v10.22.0
npm version: 6.14.6
How can I solve this issue?
EMFILE means too many files open. The process is trying to open more files than your system is permitting. On a UNIX-like operating system (which you seem to be using), you can check the limits with ulimit -Sn (for the "soft" limit) and ulimit -Hn (for the "hard" limit).
How to increase the open file limit permanently can vary. But you can try to do it temporarily like this:
ulimit -Sn will tell you the soft limit. ulimit -Hn will tell you the hard limit.128 and the hard limit is unlimited or larger than 256, then try ulimit -Sn 256Not all systems will let you increase these limits without root privileges, but many will. If this doesn't work, you may need to look up how to do it on your system.