-1

When is package.json generated? How it maintain consistency in various environments ?

  • 3
    Possible duplicate of [What is the role of the package-lock.json?](https://stackoverflow.com/questions/44297803/what-is-the-role-of-the-package-lock-json) – VLAZ Oct 14 '19 at 08:37
  • Does this answer your question? [NPM5, What is the difference of package-lock.json with package.json?](https://stackoverflow.com/questions/48456236/npm5-what-is-the-difference-of-package-lock-json-with-package-json) – Andrew Jul 01 '22 at 16:44

1 Answers1

3

package-lock.json: records the exact version of each installed package which allows you to re-install them. Future installs will be able to build an identical dependency tree.

package.json: records the minimum version you app needs. If you update the versions of a particular package, the change is not going to be reflected here.

Checkout this thread : Do I need both package-lock.json and package.json?

  • copy in here, you can comment it: https://delegatecall.com/questions/what-is-the-difference-between-packagejson-and-packagelockjson-2bd0e4e1-a65f-4d78-b8d8-b51905a37adb – mohammad javad ahmadi Oct 14 '19 at 08:39