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.
package.jsonis required - if you ever wish to add a package, it will require the use ofpackage.json- not to mention it contains the central place for human-readable analysis of packages used AND project attributes (commands, project locations, etc etc)package.json- npm wouldn't know what to do upon install for new developers