Skip to content
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

Yarn ignores invalid command line arguments #2600

Open
mprobst opened this issue Jan 31, 2017 · 4 comments
Open

Yarn ignores invalid command line arguments #2600

mprobst opened this issue Jan 31, 2017 · 4 comments

Comments

@mprobst
Copy link

mprobst commented Jan 31, 2017

Do you want to request a feature or report a bug?

A bug.

What is the current behavior?

$ yarn install --parsing-command-line-arguments-is-hard
yarn install v0.19.1
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[...]
Done in 12.71s.

If the current behavior is a bug, please provide the steps to reproduce.

yarn silently ignores unknown command line arguments. That's a usability problem, i.e. when users mistype an argument, the command silently proceeds but then fails to behave as expected, leaving a puzzled user. Combined with potentially dangerous arguments, this can be a bigger problem. Imagine installing an untrusted package that you'd like to inspect for security reasons, but misstyping --ignore-scripts.

What is the expected behavior?

$ yarn install --fried-chicken
yarn install v0.19.1
error Unknown argument "--fried-chicken".

Please mention your node.js, yarn and operating system version.

Node v5.3.0, Ubuntu.

@BYK
Copy link
Member

BYK commented Oct 27, 2017

I don't think this is a bug and it is a very good enhancement in terms of safety so marking as high-priority.

@BYK BYK changed the title Yarn ignores misstyped command line arguments Yarn ignores invalid command line arguments Oct 27, 2017
@joaoptpsa
Copy link

Me and a team of 2 others will attempt to fix this issue

@joaoptpsa
Copy link

So basically this issue is due to a issue in commander.js dependency, i created a PR for commander.js tj/commander.js#730 that would fix this, should it get accepted

@shadowspawn
Copy link

shadowspawn commented Aug 5, 2020

This is likely fixed from Commander v5: tj/commander.js#561

Update, Yarn 2 is using Clipanion: #4225 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants