Getting build errors that don't exist locally, Vercel is using wrong packagemanager?
Answered
European pilchard posted this in #help-forum
European pilchardOP
Hi everyone,
I am using bun locally for my app, and when I build and run install everything works with no errors. I am on nextjs canary 40, but had this issue before I upgraded to canary. For some reason, when I build on Vercel, I get this error:
At first it would happen immediately, so then I decided to explicitly define bun install and bun run build commands in my vercel.json, and specify packageManager: "bun@1.2.2". That made everything go smooth, and it seemed like it finished the build, then at the end, dropped that error again. Why is it trying to use npm still? I dont understand it, I will paste the entire in the attached file.
Any help would be appreciated!
I am using bun locally for my app, and when I build and run install everything works with no errors. I am on nextjs canary 40, but had this issue before I upgraded to canary. For some reason, when I build on Vercel, I get this error:
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: @kabobtech/rent-tracker@0.1.0
npm error Found: next@15.3.0-canary.41
npm error node_modules/next
npm error next@"^15.3.0-canary.40" from the root project
npm error
npm error Could not resolve dependency:
npm error peer next@">=13.5.2 || ^14.0.0 || ^15.0.0" from @novu/nextjs@3.0.3
npm error node_modules/@novu/nextjs
npm error @novu/nextjs@"^3.0.3" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /vercel/.npm/_logs/2025-04-07T15_58_46_107Z-eresolve-report.txt
npm error A complete log of this run can be found in: /vercel/.npm/_logs/2025-04-07T15_58_46_107Z-debug-0.log
Error: Command "npm install" exited with 1
At first it would happen immediately, so then I decided to explicitly define bun install and bun run build commands in my vercel.json, and specify packageManager: "bun@1.2.2". That made everything go smooth, and it seemed like it finished the build, then at the end, dropped that error again. Why is it trying to use npm still? I dont understand it, I will paste the entire in the attached file.
Any help would be appreciated!
Answered by joulev
Do you have the lock file of the other package manager in the repo? Remove them, only keep the lock file of the package manager you want to use
2 Replies
European pilchardOP
I had package-lock.json in there for way too long.... Idek how I was getting it to build before. Thank you