Published in : 2022-02-11
When I install a new NPM package, I find 2 JSON files in the project's folder, a package file and a package-lock file.
I know the use of the package file where I can find all my dependencies and also where the entry point which the project will be built from.
But I don't know the package-lock file, and weather I have to play with it or not.
Would you please help me with that?
Package.json file contains the main names of packages & libraries which you installed and you can edit it, but Package-lock.json contains the details of each package and the link of repository of each package (consider it's the details of the packages which came from package.json)
Got it! I’m so grateful!
Shilpa Date : 2022-02-26
Package-lock.json keeps track of the exact versions of every package which you are installing, so another machine can reproduce the same packages and run the application without versioning issues.
Join our community and get the chance to solve your code issues & share your opinion with usSign up Now