wclr / ts-node-dev

Compiles your TS app and restarts when files are modified.
MIT License
3.43k stars 123 forks source link

Error: ENFILE: file table overflow #81

Open Kinetic-Pulse opened 5 years ago

Kinetic-Pulse commented 5 years ago

Hey There,

Randomly when I update a file I get the following error:

Error: ENFILE: file table overflow, open '.../node_modules/feathers-hooks-common/node_modules/@feathersjs/commons/lib/arguments.js'
    at Object.openSync (fs.js:438:3)
    at Object.readFileSync (fs.js:343:35)
    at Module._extensions..js (internal/modules/cjs/loader.js:711:20)
    at Object.nodeDevHook [as .js] (.../node_modules/ts-node-dev/lib/hook.js:61:7)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (.../node_modules/feathers-hooks-common/node_modules/@feathersjs/commons/lib/commons.js:3:1[ERROR] 19:10:33 Error reading compile request file { [Error: ENFILE: file table overflow, open '/var/folders/v5/bn30c5ts5bgc10tb6dly5m3h0000gn/T/.ts-nodedAnVFi/compiled/034800003682830205.req']
  errno: -23,
  code: 'ENFILE',
  syscall: 'open',
  path:
   '/var/folders/v5/bn30c5ts5bgc10tb6dly5m3h0000gn/T/.ts-nodedAnVFi/compiled/034800003682830205.req' }
4)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Module._compile (.../node_modules/source-map-support/source-map-support.js:521:25)
    at Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Object.nodeDevHook [as .js] (.../ts-node-dev/lib/hook.js:61:7)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (.../node_modules/feathers-hooks-common/lib/services/combine.js:2:26)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Module._compile (.../node_modules/source-map-support/source-map-support.js:521:25)
[ERROR] 19:10:33 Error: ENFILE: file table overflow, open '.../node_modules/feathers-hooks-common/node_modules/@feathersjs/commons/lib/arguments.js'

The node module that it indicates in the error keeps changing so the issue is not a specific node modul, and I cant quite see a pattern in terms of when it decides to error out, just randomly it will error out during some file change.

Any advise, recommendations etc. would be welcome.

Regards,

wclr commented 5 years ago

try to run with --no-deps flag to exclude node_modules dependencies from watching

EmirGluhbegovic commented 5 years ago

Still the same result. Keeps crashing and referencing a different node-modules package. What helps at times is deleting my node_modules folder and rerunning yarn.