How to extract the closest node.js version used from existing package-lock.json?

1k Views Asked by At

My package-lock.json and package.json do not specify the node.js version used to generate the package-lock.json in my repo.

I can iterate over node versions using nvm to see which one yeilds minimal git diff to the previous package-lock file in my repo. I wonder it there is a less exhaustive and cumbersum way to do that. Are there any hints to "reverse engineer" or "extract" the node-version from the lock file?

Motivation: I don't want to keep changing my package-lock.json at each commit, and also use the same node version in the CI consistently.

0

There are 0 best solutions below