Skip to content

[BUG] --lockfile-version is not respected when using shrinkwrap and hidden lockfile #3962

@dominykas

Description

@dominykas

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

$ npm shrinkwrap --lockfile-version=2 produces a v3 lockfile.

v8.1.1 used to print a warning, but #3949 changed that.

v8.1.2 just produces a v3 lockfile without any warnings.

Expected Behavior

lockfile-version param/config should be respected.

Steps To Reproduce

  1. $ rm -rf npm-shrinkwrap.json (if the shrinkwrap exists - it seems to work OK)
  2. $ npm shrinkwrap --lockfile-version=2
  3. $ cat npm-shrinkwrap.json | jq .lockfileVersion

Actual: 3
Expected: 2

Environment

  • OS: macOS 11.6
  • Node: 14.18.1
  • npm: 8.1.2

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingPriority 1high priority issueRelease 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