DEV Community

Alireza Razinejad
Alireza Razinejad

Posted on

How to use package-lock.json

What is package-lock.json usage after all?? ๐Ÿ˜’

The answer is simple!

We want all developers to develop code with the same package versions!
Another use case is we want exactly the same package versions to be installed in the pipeline of course!!

But why when run npm i it will update package-lock.json and sometimes it will update package.json?? ๐Ÿ˜ฎ

This is its job!!!
It will make sure the latest stable package be installed!

So how do we make use of package-lock.json? ๐Ÿ™„
It's simple!
We need a clean install! ๐Ÿ˜Ž

But how? ๐Ÿ˜
with npm ci ๐Ÿค—

Top comments (0)