How do I properly commit package-lock.json

I’m trying to complete Chapter 12’s Gold Medal Metrics but when I try to install npm my terminal is asking that I commit the package-lock.json.

Does this mean I should create a .git repository in my home folder and commit package-lock.json to this repository? How do I properly commit this file so I can continue to use npm and node.js?


each project should be in its own directory and have its own git repository. Then you can just commit the package file for the project