0

When I try to install any npm package, I get the following error. And the installation gets stuck.

I've pasted the error below

Error msg:

This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!

Error screenshot

Help me to solve this problem. Thanks in Advance.

Uday
  • 57
  • 12

1 Answers1

1

The error message you mentioned is due to the fact that you are running an older version of npm. You are probably on v5 or v6 while your package-lock.json was generated with v7+.

However, that message is usually a warning, and not a final error. Would double check to see if you have other error messages as well.

More details for package-lock.json versions at: https://docs.npmjs.com/cli/v8/configuring-npm/package-lock-json#lockfileversion

0xBobby
  • 286
  • 3
  • 6