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

Closed
henryiii opened this issue Jul 19, 2021 · 5 comments · Fixed by #2996
Closed

Use of --dev deprecated for npm #1983

henryiii opened this issue Jul 19, 2021 · 5 comments · Fixed by #2996

Comments

@henryiii
Copy link

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

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

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

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

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

@sanmai-NL
Copy link

@asottile And here we are.

RoelAdriaans added a commit to RoelAdriaans/pre-commit that referenced this issue Sep 8, 2023
shaperilio pushed a commit to shaperilio/pre-commit that referenced this issue Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants