package.json
: list of module needs for projectpackage-lock.json
: same idea but with lock specific version that already works when runnpm i
frompackage.json
- Semantic Versioning (semver) has structure like: ^MAJOR.MINOR.PATCH
- With ^ when run
npm i
it will install newest version of the same MAJOR. But with the newest MINOR or PATCH (install on new pc) could cause some issue or bug - The package-lock.json solves this by defining the MAJOR.MINOR.PATCH preciously that works.
package.json
:npm i
package-lock.json
:npm ci