Error "The command line is too long" when trying to run jscodeshift with a pattern match which returns many files #648
Replies: 1 comment
-
This is a limitation of shells in Windows. You're right that the shell is expanding the glob and passing all the files on the command line. In bash/zsh/etc, you can run You could just pass a directory name and let jscodeshift traverse the files itself. That should work fine as long as your transform returns Alternatively, you could try using jscodeshift in WSL (Windows Subsystem for Linux), which should use the higher limits since it's a real(-ish) Linux environment rather than just some tools that have been ported to Windows. |
Beta Was this translation helpful? Give feedback.
-
I am getting "The command line is too long" when trying to run jscodeshift with a pattern match which returns 147 files. I am guessing this is because it passes all of the filenames on the command line. If I transform just a handful of files it works fine.
Can you let me know how I can resolve this issue please.
I am running this using Bash (MINGW64) on Windows 11. I can't use command prompt or PowerShell as they don't understand the globs like "**/*.spec.ts".
Beta Was this translation helpful? Give feedback.
All reactions