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.

Add package-lock.json to .gitignore

See original GitHub issue

When cloning the app, it seems like package-lock.json is present while it probably shouldn’t, because it is changed when the package is built. It is a per-developer, developer-specific auto-generated file and should be discarded from the git repository.

As a side node, I think it would be appropriate to use gitignore.io to generate a proper template for the .gitignore

1-before 2-after

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
NatoBoramcommented, Nov 25, 2018

Oh! Then, I feel like it would be justified to change the readme from npm install to npm ci. It would prevent having an unclean repo when building the app

1reaction
hacdiascommented, Nov 24, 2018

@NatoBoram if we use npm ci it will install the exact same dependencies without updating them: https://docs.npmjs.com/cli/ci. It’s useful to use in test environments to make sure everything is the same.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Should the package-lock.json file be added to .gitignore?
No, the package-lock.json SHOULD NOT be added to .gitignore . Instead, I strongly advise: Add the package-lock.json you to your version ...
Read more >
Add package-lock.json to .gitignore #26 - GitHub
Describe the bug. Add package-lock.json to .gitignore with a comment saying it's ignored because the project uses yarn. ; To Reproduce. Run npm ......
Read more >
package-lock.json - in GIT or not? - DEV Community ‍ ‍
One solution for this problem is to commit the node_modules folder to GIT, which includes all of the code your application uses. This...
Read more >
Should the package-lock.json file be added to .gitignore?
Depends on the situation, but usually no. You'd only want to add it if there is value in the fixation of the versions....
Read more >
Should I include package-lock.json in source control?
To recap, you should always include both package.json and package-lock.json in your source control. Thus, never put them in the .gitignore file.
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