Jest & lint fails with the following ERROR: NX ERROR spawn E2BIG
See original GitHub issueBoth my jest & lint fails with the following ERROR: NX ERROR spawn E2BIG
this is happening only on the CI pipeline. but the same works well in my local machine.
$ yarn affected:test
yarn run v1.22.5
$ ./node_modules/.bin/nx affected:test --base=origin/test-code --parallel --detectOpenHandles --forceExit
> NX ERROR spawn E2BIG
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:19 (3 by maintainers)
Top Results From Across the Web
Error: spawn E2BIG - Questions - n8n community
Hi, I'm using the response of http request of a web page that returns a thread dump of java process (that could be...
Read more >How to fix spawn ENAMETOOLONG error nrwl nx workspace
This error usually appears when you have too many uncommited files (in a range more than 700 or so in my experience).
Read more >[PM2][ERROR] Process failed to launch spawn E2BIG - Medium
I dreamed about debugging for a long time and looking for a problem. It turned out that the problem is a stack overflow...
Read more >passwords.txt - CMU School of Computer Science
... ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oA oB...
Read more >Error: spawn E2BIG #166 - Issuehunt
The issue has been closed. Error: spawn E2BIG #166. andreasgrimm posted onGitHub ... spawnWithSignal [as spawn] (child_process.js:717:17) at /Users/.
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 Free
Top 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
OK. After some debugging I was able to resolve the issue in our repo. I’ll try to explain the solution, hopefully its useful for others as well.
Also: Thank you for building NX! It’s an awesome tool and we love using it.
Our setup:
1. We use cypress, and specify cypress cache folder like:
2. We specify a cache object to reuse among jobs:
3. We have an ‘install’ job.
Note: cypress cache-folder amounts to almost 26.000 (!) files.
4. We have a ‘lint’ job.
Result:
The solution:
Cypress cache was adding ~26.000 files, which are all checked by the
affected
command, causing it to fail. Adding/cache
(our custom cypress cache location) to.gitignore
makes NX ignore all of these files.The
affected:lint
command now run smoothly again for us.Yep I am facing this is an issue also with freshly apps workspace and adding new node app using
@nrwl/node
generator