[Bug] `yarn workspaces foreach exec` fails
See original GitHub issue- I’d be willing to implement a fix
Describe the bug
yarn workspaces foreach exec
fails
To Reproduce
I am trying to run depcheck
in every workspace, but it seems that exec
, while a valid yarn
command, is not passed through by yarn workspaces foreach
. Is this a bug or is exec
not meant to be supported?
yarn workspaces foreach exec depcheck
Usage Error: Invalid subcommand name for iteration - use the 'run' keyword if you wish to execute a script
Issue Analytics
- State:
- Created 3 years ago
- Comments:23 (17 by maintainers)
Top Results From Across the Web
`yarn workspaces foreach` | Yarn - Package Manager
If the command is run and the script being run does not exist the child workspace will be skipped without error.
Read more >Advanced package manager features for npm, Yarn, and pnpm
Don't think a lot about your package manager? Learn more in this article about the advances in package manager features you may have...
Read more >Beware of Colons in Yarn Scripts - DEV Community
A script with a colon in its name implicitly "exists" in every workspace, so yarn workspaces foreach run will always execute it in...
Read more >A guide through The Wild Wild West of setting up a mono repo ...
We will be using TypeScript, Yarn workspaces, Lerna, and Jest. ... going to need the git history when someone discovers a bug after...
Read more >Maël Twitterren: "8 ⚡️ You can use `yarn workspaces focus ...
It's a tiny bit slower, but you get the certainty that your project is in a good state if `yarn install` exits without...
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
@DerekZiemba You’re using Yarn Classic (v1), while
yarn workpaces foreach
is a Yarn 2 feature. You can consult the installation guide to install Yarn 2. If it still doesn’t work, you should probably open another issue, as it’s unlikely it would be related to this one.It will skip over scripts that don’t declare a script of this name, yes. However it probably should execute it too if there’s a binary of the specified name, so if it doesn’t do so already I’d see that as a bug.