Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

3.1K
Visualizações
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 Respostas
Responde à pergunta

0

works for me like this:

npm cache clean --force

npm fund

npm audit fix --force
over 4 years ago · Santiago Trujillo Relatório

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 Relatório

0

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

over 4 years ago · Santiago Trujillo Relatório

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 Relatório

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 Relatório

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 Relatório

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 Relatório

0

Try running this command: npm cache clean --force

over 4 years ago · Santiago Trujillo Relatório

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 Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda