0

I have noticed that npm creates numerous package-lock*.json files in the root directory of my project. I am not sure why so many files are created or what they are used for.

The generated files are depicted in the image. Can anyone help me with this problem? Is this typical behavior?

enter image description here

Maulik Kakadiya
  • 1,467
  • 1
  • 21
  • 31

1 Answers1

0

Oftentimes, a .history or .cache folders will be made and create backup files for evenry move you make.

The best way I've found to git rid of this issue is us the .gitignore file to specify the paths to those files and exclude them from git.

For me it was /angular/cache/*.json, .history, and .angular/cache/, but there may be a specific path/folder that you need to exclude.

Also, to prevent this from happening in the future you can make your .gitignore global and reference those files for all your projects so you don't have to make a new one each time.

Micah
  • 479
  • 1
  • 7
  • 17