Let's consider npm 5.3.0+
.
Imagine I've just created package.json
in empty directory and run npm i
. Then I've edited package versions in package.json
. At this point, package.json
is inconsistent with package-lock.json
.
Question: what happens if I run npm i
again? Which file would be the source of truth? In npm docs I've found only a vague statement "Whenever you run npm install, npm generates or updates your package lock".
Same question for yarn.