I know you're supposed to add package-lock.json to your git repo to ensure team members are using the same versions of dependencies.
Running npm install
will check for a package-lock.json and install the versions indicated there. If a lock file is not present it will install packages from their sources as indicated by package.json.
Should package.json be added to your git repo as well, then?
If not, a new team member who clones the repo would get the lock file but a package.json file cannot be generated from a lock file, correct?
Bonus question: How should one handle merge conflicts in package-lock.json? Since they are machine-generated, I find that this happens often and its not always clear how they should be resolved.