Why it’s important to push package.lock.json

Sami C.
1 min readApr 8, 2019

--

I always visualize the locks as packages — Photo by Thomas Q on Unsplash

Why is the package.lock.json important?

Bottom line, the package.lock.json guarantees the exact same version of every package. We have to remember ourselves that the package.json has the option to add carets to packages like:^1.0.6, this will install version 1.0.6 or the most recent major version 1.1.0. The package.lock.json makes sure that the packages that are installed have a fixed version, and this can be used to ensure the exact same version of every package across your team.

I’ve seen this question quite a lot in my office, so hopefully this will help others!

Happy coding!

--

--

Sami C.
Sami C.

Written by Sami C.

Freelance Software Engineer

No responses yet