is package-lock.json needed to commit code example
Example 1: npm generate package-lock.json
npm install --package-lock
Example 2: how to generate package-lock.json from package.json
Have you deleted package-lock.json file? don't worry
Run below command to generate package-lock.json file in your folder.
npm i --package-lock-only