-
-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Glob matching does not work when specified in script using Yarn 2 #200
Comments
I just ran into this myself. If you quote the Try this:
|
Thanks for the tip, that works! I do think the root cause of this should be fixed however (whether here or in Yarn 2) |
I ended up falling for that too. Please add it to the documentation |
I don't think this is a bug for both sides. Please don't get mad at me; I was also confused by the error. However, It seems like expanding the wildcard is the expected behaviour of Yarn, and it doesn't look like |
Glob matching does not work when specified in script using Yarn 2. Refer to mysticatea/npm-run-all#200
Ref mysticatea/npm-run-all#200 Fix remix-run#2033 from: https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#type from: https://www.conventionalcommits.org/en/v1.0.0/ from: https://cheatography.com/albelop/cheat-sheets/conventional-commits/ from: https://gist.github.com/lisawolderiksen/a7b99d94c92c6671181611be1641c733
Thanks very much for this. I had to line up all related script commands on one line as I didn't know what to do. |
Hey, just had the issue too.
Agree, but adding it to the doc could be a good help, it avoids people to look for this issue 🙂. |
Ditto to all of the above. Thank goodness for github issues and threads like these. This was the first thing that broke when I updated to yarn 2, given that the docs say it will work with yarn this was a little confusing to find the solution here. |
Adding double quotes works for me in Yarn 4.0.0-rc.27: "scripts": {
"echo:bar": "echo \"bar\"",
"echo:foo": "echo \"foo\"",
- "echo": "npm-run-all echo:*"
+ "echo": "npm-run-all \"echo:*\""
} Otherwise, it says |
Yarn 2+ expands glob patterns using its own shell and fails the `lint` script. Quote the pattern to prevent premature expansion. Escaped double quotes are used for compatibility with cmd.exe. Related-Bug: mysticatea/npm-run-all#200 yarnpkg/berry#1814
Yarn 2+ expands glob patterns using its own shell and fails the `lint` script. Quote the pattern to prevent premature expansion. Escaped double quotes are used for compatibility with cmd.exe. Related-Bug: mysticatea/npm-run-all#200 yarnpkg/berry#1814
I find it odd that this works for all the other manager packages (npm, yarn classic, pnpm, bun), but not for modern Yarn. 😅 |
Running a script
echo: run-p echo:*
defined inpackage.json
will not work on Yarn 2.Example
package.json
:To reproduce:
yarn init -y
yarn add -D npm-run-all
package.json
:"echo:foo": "echo 'foo'"
"echo:bar": "echo 'bar'"
"echo": "run-p echo:*"
yarn set version berry
yarn echo
=> No matches found: "echo:*"
Oddly enough, running
yarn run-p echo:*
directly does still workReproduction repo: https://github.com/Robin-Hoodie/yarn2-npm-run-all-repro
The text was updated successfully, but these errors were encountered: