I have understood the details from the below link but still when to use which file is a question ?
https://docs.npmjs.com/files/package-lock.json
Contains relevant metadata for your project including dependancies, helper scripts and other general metadata.
Running npm install --save <package>
or yarn add <package>
adds dependancies to this file.
Between the three files listed, this is the only one you should ever need to interact with.
Is an auto generated file that describes the exact state of your application dependancies the last time packages where added or modified.
More specifically it guarantees the order of package installations between users - hence why it is recommended to be git committed.
yarn.lock is generated when running yarn
specific commands.
package-lock.json is generated when running npm
specific commands.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With