Cypress crashing on Linux > System limit for number of file watchers reached 'package.json'
See original GitHub issueHi, daily user of Cypress here. Just found this corner case where Cypress.js is crashing.
Steps to reproduce
Not exactly sure but overall this is the scenario.
- Open a bunch of processes which subscribe to
package.json
changes. In my case: two WebStorm windows & react build tools - Open Cypress, open the project directory and run all tests in Chrome
- Cypress will crash right after opening Chrome with the following output:
Cypress process output
{
errno: -28,
syscall: 'watch',
code: 'ENOSPC',
path: '/home/jake/DEV/dedupe-refresh/package.json',
filename: '/home/jake/DEV/dedupe-refresh/package.json'
}
Error: ENOSPC: System limit for number of file watchers reached, watch '/home/jake/DEV/dedupe-refresh/package.json'
at FSWatcher.start (internal/fs/watchers.js:165:26)
at Object.watch (fs.js:1329:11)
at createFsWatchInstance (/home/jake/.cache/Cypress/4.3.0/Cypress/resources/app/packages/server/node_modules/watchify/node_modules/chokidar/lib/nodefs-handler.js:38:15)
at setFsWatchListener (/home/jake/.cache/Cypress/4.3.0/Cypress/resources/app/packages/server/node_modules/watchify/node_modules/chokidar/lib/nodefs-handler.js:81:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/jake/.cache/Cypress/4.3.0/Cypress/resources/app/packages/server/node_modules/watchify/node_modules/chokidar/lib/nodefs-handler.js:233:14)
at FSWatcher.NodeFsHandler._handleFile (/home/jake/.cache/Cypress/4.3.0/Cypress/resources/app/packages/server/node_modules/watchify/node_modules/chokidar/lib/nodefs-handler.js:262:21)
at FSWatcher.<anonymous> (/home/jake/.cache/Cypress/4.3.0/Cypress/resources/app/packages/server/node_modules/watchify/node_modules/chokidar/lib/nodefs-handler.js:495:21)
at callback (/home/jake/.cache/Cypress/4.3.0/Cypress/resources/app/packages/server/node_modules/graceful-fs/polyfills.js:289:20)
at FSReqCallback.oncomplete (fs.js:159:5)
GET /__cypress/tests?p=cypress/support/index.js-271 - - ms - -
GET /__cypress/tests?p=cypress/integration/2.rwandaAllDedupes.test.js-101 - - ms - -
GET /__cypress/tests?p=cypress/integration/1.filterOptions.test.js-697 - - ms - -
/home/jake/.cache/Cypress/4.3.0/Cypress/Cypress --no-sandbox -- --cwd /home/jake/DEV/dedupe-refresh[19436]: ../../third_party/electron_node/src/node_platform.cc:449:std::shared_ptr<PerIsolatePlatformData> node::NodePlatform::ForIsolate(v8::Isolate *): Assertion `data' failed.
The Test Runner unexpectedly exited via a exit event with signal SIGABRT
Please search Cypress documentation for possible solutions:
https://on.cypress.io
Check if there is a GitHub issue describing this crash:
https://github.com/cypress-io/cypress/issues
Consider opening a new issue.
----------
Platform: linux (Ubuntu Linux - 19.10)
Cypress Version: 4.3.0
System
Ubuntu 19.10 Cypress 4.3.0 node.js v12.16.1
Thanks! I love cypress. Let me know if I can provide more info.
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (2 by maintainers)
Top Results From Across the Web
System limit for number of file watchers reached - Stack Overflow
I solve this issue this way rm -rf node_modules rm package-lock.json yarn.
Read more >Changelog - Cypress Documentation
Fixed an issue where file watchers were not completely closed prior to the Cypress App quitting, causing crashes on exit in some macOS...
Read more >ENOSPC: System limit for number of file watchers reached.
This problem seems to affect especially Linux users like myself. I can't confirm this for sure as I run only Linux- distribution.
Read more >Error: ENOSPC: System limit for number of file watchers ...
When developing JavaScript-based applications on App Service Linux, notably ones that also come with a development server (e.x, ...
Read more >node:internal/fs/watchers:252 throw error; - You.com | The AI ...
... Error: ENOSPC: System limit for number of file watchers reached, watch '/var/opt/thelounge/packages/package.json' at FSWatcher.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also, FYI, I have file watching explicitly disabled in
cypress.json
, but it’s still crashing:Hi,
I think I meet the same problem that the options for disabling file watch do not work (it’s happened at 7.7.0):
https://github.com/berviantoleo/react-multi-crop/runs/3018043472?check_suite_focus=true
Since my configuration like this:
https://github.com/berviantoleo/react-multi-crop/blob/master/examples/demo/cypress.json
But it’s fine when at 7.6.0:
https://github.com/berviantoleo/react-multi-crop/runs/2958413049?check_suite_focus=true