Skip to content

[BUG] NPM UPDATE removes dependencies #2322

Closed
@artus

Description

@artus

Current Behavior:

npm update --no-save --dev removes dependencies from the node_modules folder.

Also, the documentation states that As with all commands that install packages, the --dev flag will cause devDependencies to be processed as well. but I can't find the --dev flag in any other part of the documentation. Shouldn't it be --save-dev instead?

Expected Behavior:

npm update --no-save --dev should update all dependencies (including dev dependencies) and NOT remove dependencies from the node_modules folder.

Steps To Reproduce:

I have a package.json with the some dev dependency:

"devDependencies": {
  "some-dependency": "latest",
...
}

When I run npm update --no-save --dev my dev depdency sometimes gets updated, but sometimes it just completely dissapears from the node_modules folder.

Every subsequent run results in the package being there or not being there:

  1. npm update --no-save --dev => package is there
  2. npm update --no-save --dev => package is no longer there
  3. npm update --no-save --dev => package is there again
  4. npm update --no-save --dev => package is again no longer there
  5. npm update --no-save --dev => package is there again
  6. npm update --no-save --dev => package is again no longer there
  7. ...

Environment:

  • OS: Windows 10
  • Node: v10.16.0
  • npm: 6.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingRelease 6.xwork is associated with a specific npm 6 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions