Create package.json from package-lock.json

Sandeep kurien picture Sandeep kurien · Apr 26, 2018 · Viewed 21.3k times · Source

I downloaded a theme and it has a package-lock.json file but no package.json file. Is there a way I can generate the package.json from the package-lock.json file. How do I install the node modules with just the package-lock.json file. Is there a way to do that?

Answer

VeeeneX picture VeeeneX · Aug 20, 2018

Install the latest npm with npm install -g npm

Run npm init and respond to the questions.

The above command will generate a package.json and include the existing packages listed in package-lock.json