question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chore: add npm5 generated `package-lock.json` to git repo?

See original GitHub issue
  • NPM 5 will automatically create a package-lock.json when installing packages unless there’s already npm-shrinkwrap.json in which case it will update it instead (if necessary).

  • The new package-lock.json is never published and should be added to your version control system.

or if we do not add it to git repo, better add to .gitignore.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
not-an-aardvarkcommented, Jun 16, 2017

If we put package-lock = false in .npmrc, I think npm won’t generate a package-lock.json file at all.

2reactions
mysticateacommented, Jun 16, 2017

I think we should not ignore package-lock.json. If package-lock.json exists, npm seems to ignore package.json. As a result, I guess local package-lock.json will cause confusing if git pull changes package.json.

I think our options are:

  1. Add package-lock.json into our repo.
  2. Add .npmrc which disables package-lock.json into our repo.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Do I commit the package-lock.json file created by npm 5?
Short answer: yes. One comment: when package-lock.json changes you can make a commit of just that change, separate from other source changes.
Read more >
package-lock.json - in GIT or not? - DEV Community ‍ ‍
This creates a problem by itself because then every npm install will create thousands and more changes, and will make it impossible to...
Read more >
package-lock.json - npm Docs
Description. package-lock.json is automatically generated for any operations where npm modifies either the node_modules tree, or package.json .
Read more >
Cordova-lib Release Notes - Gitea
... dependency on cordova-create; GH-841 chore: add package-lock.json ... CB-12762 point package.json repo items to github mirrors instead ...
Read more >
package-lock.json does not exist - You.com | The search ...
Removes node_modules and install all dependencies at once. It never writes to package.json or package-lock.json . Algorithm. While npm ci generates ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found