-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[BUG] Using --
to pass additional arguments incorrectly wraps those arguments in quotes
#2720
Comments
NPM is removing double quotes from any part of the command: In my case I have:
It tries to execute as: Instead of: I tried escaping in other ways but didn't work :/ |
That does not look like it's related to using |
This was fixed in run-script here: npm/run-script#22 and should be included w/ the next npm release (going out this week) |
@wraithgar It's working like a charm. I think you can close this one 👍 |
I am on npm 7.11.0 and problem with arguments passed in quotes is still here.
If I run if I change 'g' task to |
@cyberbiont please open a new issue for this, as this was specifically a windows wrapping bug, and yours may be different in ways the issue template should show us. |
Current Behavior:
Using
--
to pass additional arguments incorrectly wraps those arguments in quotesExpected Behavior:
Using
--
to pass additional arguments does what https://docs.npmjs.com/cli/v6/commands/npm-run-script claims it will do:I take "directly" here to mean "without any kind of rewriting"
Steps To Reproduce:
a package.json with:
shows:
instead of
Reason this is a bug
this makes it impossible to forward flags with escaped quotes. For example, passing a quoted string (in which the quotes must be preserved) to
esbuild
becomes impossible:Note the escaped
development
string, which is escaped once so"
doesn't break the script string, and escaped a second time so that it's passed correctly as CLI argument.This should run, but instead because things get wrapped in quotes, this errors out:
Note the line above the error: we suddenly have quoted arguments in which
--define:process.env.NODE_ENV=\\\"development\\\"
has been rewritten such that it actually loses quotes:"--define:process.env.NODE_ENV=\\\\development\\\\"
no longer has a quote preceding thed
indevelopment
.Nothing should be rewriting args passed further along with
--
, those should stay exactly as they were.Environment:
Windows 10 Pro x64
Node 15..8.0
npm 7.3.0
The text was updated successfully, but these errors were encountered: