Skip to content

[BUG] npm install command automatically pruning packages even when package-lock config is disabled #3906

Closed
@KochiyaOcean

Description

@KochiyaOcean

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When install using install command with package-lock config disabled, the npm will still prune packages automatically and remove packages that did not appears in package-lock.json

Expected Behavior

According to the document https://docs.npmjs.com/cli/v7/using-npm/config#package-lock , the automatically pruning should be disabled when package-lock config is disabled

Steps To Reproduce

  1. Open shell in an empty folder
  2. Run npm install --no-save --package-lock false lodash
  3. The lodash module will be installed in the node_modules folder in the cwd folder, and package-lock.json is not created
  4. Run npm install --no-save --package-lock false underscore
  5. The underscore module will be installed, but the lodash module is removed

Environment

  • OS: Windows 10
  • Node: 16.10.0
  • npm: 8.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 8.xwork is associated with a specific npm 8 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions