Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow --lockfile-version config to be string and coerce to number #3949

Merged
merged 1 commit into from Oct 27, 2021

Commits on Oct 27, 2021

  1. fix: allow --lockfile-version config to be string and coerce to number

    As all CLI input is considered to be string, eg. a
    "npm install --lockfile-version 3" would fail with the error messages:
    
    ```
    npm WARN invalid config lockfile-version="3" set in command line options
    npm WARN invalid config Must be one of: null, 1, 2, 3
    ```
    
    Until we have a config system that supports setting type and possible values
    of configs, we have to specify all string and number values for the
    `lockfile-version`, but we coerce all values to numbers in the flattener.
    
    Co-authored-by: @voxpelli
    Co-authored-by: @isaacs
    
    PR-URL: #3949
    Credit: @lukekarrys
    Close: #3949
    Reviewed-by: @isaacs
    voxpelli authored and lukekarrys committed Oct 27, 2021
    Copy the full SHA
    cb9f435 View commit details
    Browse the repository at this point in the history