如何使用loadVirtual和ENOLOCK修复npm审计错误?
? npm audit
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
我运行 npm audit 并收到此错误。
当我在下面运行时:
? npm config get package-lock
true
? npm config get shrinkwrap
true
有人可以帮忙吗?至于如何解决?并且 npm audit fix --force 也无法正常工作...
回答
我只是运行了它所说的命令。
npm i --package-lock-only
然后它向我展示了 0 个漏洞。无论如何,再次运行审核修复并再次运行 0 个漏洞。