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.

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for your reply @ivn_bogdan Now how can I get rid of that error?
Even though I use the node 16.15.0 version I'm getting an error as Unexpected Token '.' @0xBobby

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.