Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

3.1K
Views
how to fix npm audit error with loadVirtual and ENOLOCK?
➜   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

I ran npm audit and got this error.

When I run below:

➜ npm config get package-lock
true

➜ npm config get shrinkwrap
true

Can anybody help with this? as to how to fix it? and npm audit fix --force is not working as well...

over 4 years ago · Santiago Trujillo
11 answers
Answer question

0

works for me like this:

npm cache clean --force

npm fund

npm audit fix --force
over 4 years ago · Santiago Trujillo Report

0

You need to create package-lock.json, run

npm install

then

npm audit fix

you won't have the problem

over 4 years ago · Santiago Trujillo Report

0

Use Node 14, it fixed the issue with 0 vulnerabilities.

over 4 years ago · Santiago Trujillo Report

0

Try running these:

npm i --package-lock-only
npm config get package-lock
npm config get shrinkwrap
npm i --package-lock-only
npm audit fix

From here.

over 4 years ago · Santiago Trujillo Report

0

I read this and really helpful:

https://medium.com/illumination/how-to-fix-npm-audit-error-with-loadvirtual-and-enolock-deprecated-dependencies-1f07ba65eef9

npm i --package-lock-only npm config get package-lock npm config get shrinkwrap npm i --package-lock-only npm audit fix

(When running ‘npm config get package-lock’ and ‘npm config get shrinkwrap’, you will receive ‘true’ for both) — → After running ‘npm audit fix’, you will see: “up to date, audited… found 0 vulnerabilities”

over 4 years ago · Santiago Trujillo Report

0

I updated to the latest version of npm with npm install -g npm@8.3.0, and now it shows no more problems...

over 4 years ago · Santiago Trujillo Report

0

Try these command.

npm i --package-lock-only
npm config get package-lock
npm config get shrinkwrap
npm i --package-lock-only
npm audit fix
over 4 years ago · Santiago Trujillo Report

0

Try running this command: npm cache clean --force

over 4 years ago · Santiago Trujillo Report

0

Had the same error, then realized I was in a parent folder. So this may happen if there's no lock file.

over 4 years ago · Santiago Trujillo Report

0

I just ran the command it says to.

npm i --package-lock-only

Then it showed me 0 vulnerabilities. Anyway, ran again audit fix and again 0 vulnerabilities.

over 4 years ago · Santiago Trujillo Report

0

That error tells you the root of the problem: This command requires an existing lockfile.. This implies that you don't already have a package-lock.json along side the package.json you're trying to audit. npm i --package-lock-only just generates/updates package-lock.json without reinstalling; npm i would reinstall and generate one (based on your config).

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!