Visitar URL original
Use of --dev deprecated for npm · Issue #1983 · pre-commit/pre-commit · GitHub
The Wayback Machine - https://web.archive.org/web/20220603150250/https://github.com/pre-commit/pre-commit/issues/1983
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

Use of --dev deprecated for npm #1983

Open
henryiii opened this issue Jul 19, 2021 · 4 comments
Open

Use of --dev deprecated for npm #1983

henryiii opened this issue Jul 19, 2021 · 4 comments

Comments

@henryiii
Copy link

@henryiii henryiii commented Jul 19, 2021

I'm seeing this warning sometimes (output seems to be hidden unless the install fails):

npm WARN install Usage of the `--dev` option is deprecated. Use `--include=dev` instead.

Which seems to be because of this:

'npm', 'install', '--dev', '--prod',

The problem with this command was that it installed dependencies recursively, rendering them useless (AFAICT, not a node expert). The developers decided it was only a footgun in npm/npm#5554 (comment) and deprecated in npm/npm#6200.

@asottile
Copy link
Member

@asottile asottile commented Jul 19, 2021

it's a break either way to change it -- since old npm doesn't support the new flag

the unfortunate thing is that's the command that was recommended by the npm team so...

@henryiii
Copy link
Author

@henryiii henryiii commented Jul 19, 2021

What about selecting the flag based on npm version, could that be done here? If so I could look up the version that --include=dev was added.

@asottile
Copy link
Member

@asottile asottile commented Jul 19, 2021

good luck parsing npm's version and doing anything reasonable with it 😆 . I don't think that's a solution which gives long term stability

@asottile
Copy link
Member

@asottile asottile commented Aug 31, 2021

did some research on this, and it looks like we can't replace the code we have for this until at least npm 6.x is no longer supported. which would be the EOL of node 14 2023-04-30

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

No branches or pull requests

2 participants