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

Remove package-lock.json from the .gitignore file #43

Open
nickspaargaren opened this issue Sep 5, 2024 · 0 comments
Open

Remove package-lock.json from the .gitignore file #43

nickspaargaren opened this issue Sep 5, 2024 · 0 comments

Comments

@nickspaargaren
Copy link

Commit the package-lock.json

You should be committing the package-lock.json and removing package-lock.json from .gitignore.

NPM docs:

This file is intended to be committed into source repositories, and serves various purposes:

Describe a single representation of a dependency tree such that teammates, deployments, and continuous integration are guaranteed to install exactly the same dependencies.

Provide a facility for users to "time-travel" to previous states of node_modules without having to commit the directory itself.

Facilitate greater visibility of tree changes through readable source control diffs.

Optimize the installation process by allowing npm to skip repeated metadata resolutions for previously-installed packages.

As of npm v7, lockfiles include enough information to gain a complete picture of the package tree, reducing the need to read package.json files, and allowing for significant performance improvements.

Source: https://docs.npmjs.com/cli/v10/configuring-npm/package-lock-json

How

  1. Remove the package-lock.json line from .gitignore.
  2. Run npm install.
  3. Commit your changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant