Skip to content

[BUG] npm invalid config warning duplicates lock file version #6404

Description

@broksonic21

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

If you have lockfile-version=5 by mistake (or anything other than missing, 1, 2 or 3) in the .npmrc, npm warnings/errors show a non-uniq list of error cases - null, 1, 2, 3, 1, 2, 3

npm WARN invalid config lockfile-version="5" set in /Users/REDACTED/REDACTED/REDACTED-website/.npmrc
npm WARN invalid config Must be one of: null, 1, 2, 3, 1, 2, 3
npm ERR! Invalid lockfileVersion config: 5

Expected Behavior

Should uniq, and return just null, 1, 2, 3

npm WARN invalid config lockfile-version="5" set in /Users/REDACTED/REDACTED/REDACTED-website/.npmrc
npm WARN invalid config Must be one of: null, 1, 2, 3
npm ERR! Invalid lockfileVersion config: 5

Steps To Reproduce

With npm 9.6.5

have a package.json and an .npmrc
in the .npmrc, have this

lockfile-version=5

run npm install

Get the warning

Environment

  • npm: 9.6.5
  • Node.js: v18.16.0
  • OS Name: Mac

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 9.xwork is associated with a specific npm 9 release

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions