How to run npm audit only using an npm-shrinkwrap file

12 views Asked by At

I have the situation where only npm-shrinkwrap.json is available. How can I run npm audit with shrinkwrap but without package.json?

Running npm audit in a directory with only the shrinkwrap file results in

npm ERR! code ENOLOCK
npm ERR! audit This command requires an existing lockfile.
npm ERR! audit Try creating one first with: npm i --package-lock-only
npm ERR! audit Original error: loadVirtual requires existing shrinkwrap file

However, I have no package.json file available at that point, which is why the installation of a lockfile does not work.

Is this even possible?

0

There are 0 answers