Skip to content

[BUG] npm shrinkwrap renames out of date package-lock #3951

Description

@aovchinn

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

with disabled package-locks in npm config npm shrinkwrap command produces different result based on presense of package-lock.json file

if it is present it just renames it, but actual node_modules could be different at that moment
if it is not present it would calculate up to date npm-shrinkwrap.json

Expected Behavior

npm shrinkwrap should give the same output with or without package-lock.json
shrinkwraps from case (a) and case (b) in Steps To Reproduce should be the same
I expect them to be, should they though ?

Steps To Reproduce

case (a)

  • npm install (package-lock.json generated)
  • set package-lock = false in npm config
  • update version of a package in package.json
  • npm install
  • npm shrinkwrap (just a rename of old, outdated package-lock.json)

case (b)

  • all steps from case (a)
  • rm package-lock.json npm-shrinkwrap,json
  • npm shrinkwrap (new shrinkwrap is generated, with up to date data from node_modules)

Environment

  • OS: Windows 10 Home 21H1 19043.1288
  • Node: v16.13.0
  • npm: 8.1.1

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingPriority 2secondary 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