npm 5 was released today and one of the new features include deterministic installs with the creation of a package-lock.json
file.
Is this file supposed to be kept in source control?
I'm assuming it's similar to yarn.lock
and composer.lock
, both of which are supposed to be kept in source control.
Yes,
package-lock.json
is intended to be checked into source control. If you're using npm 5+, you may see this notice on the command line:created a lockfile as package-lock.json. You should commit this file.
According tonpm help package-lock.json
: