Skip to content

Do not encourage to publish package-lock in the source code version control as a general practice #810

Open
@cseas

Description

@cseas

Opening this here again as the repository of the earlier reported issue got archived.
npm/npm#20603

The npm documentation mentions it clearly that package-lock is always meant to be committed, leaving library authors unaware of the risk that their consumers might install different dependency versions than what they're using.

The documentation should be changed to mention that since package-lock files are ignored in published npm packages, library authors should exercise caution when choosing to commit them to source code.

Examples:

  1. https://docs.npmjs.com/cli/v6/configuring-npm/package-locks#using-locked-packages
It is highly recommended you commit the generated package lock to source control
  1. https://docs.npmjs.com/cli/v10/configuring-npm/package-lock-json#description
This file is intended to be committed into source repositories

Article with reasoning:
https://gajus.medium.com/stop-using-package-lock-json-or-yarn-lock-909035e94328

cc: @gajus

Metadata

Metadata

Assignees

No one assigned

    Labels

    contentIssues or PRs related to the content of the docs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy