1

On my NextJS project, I got this error on Vercel:

warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.

Vercel package-lock.json file error

I made my research and I got this solution:

Timer: You should install Next.js in your project via:

Why not? So, I did it on my project and this is the result changes:

Results of instaling nextjs on a nextjs project

"next": "12.2.5", -> "next": "^12.2.5",

My question: ¿What is the difference? Thanks Miguel

1 Answers1

2

Your First Error shows that your lock file is created by using npm & you are installing now with yarn , so sometimes it causes issue. so it better to delete lock files while installing with other package managers like yarn.

seconde issues..

"12.2.5" - it must install exact version .

^12.2.5 - It will update you to all future minor/patch versions. eg: ^12.2.5 will use releases from 12.2.5 to <13.0.0.

Refer.. What's the difference between tilde(~) and caret(^) in package.json?

sms
  • 1,380
  • 1
  • 3
  • 5