Fixing (Command "pnpm/npm run build" exited with 1) error
tags
dev
type
Post
summary
fixing vercel deployment error
status
Published
Text
slug
Files & media
date
Feb 11, 2025

lately I’ve been deploying some projects on Vercel and I’ve came across the same error multiple times, whether it’s when I’m starting a new project or when i update the connected repository, this error kept happening pretty often, so i thought heck, why not share what worked for me?
So in this article I’ll be showing you 3 ways that helped me deploy without this problem
Note: These methods where done on Next.js projects but this should work fine with react projects too.
1. Change the Node.js Version
Usually when you start a new project in Vercel, it sets the node version to the latest version. As of today the default Node.js version set is 22.X . This may change in the future so keep that in mind.
Here is how to know if you have to change your Node.js version or not:
1. Check your node.js version
You can easily do this by opening a terminal and typing the following command
After entering this command if your the version is anything above 22.X
You’ll have to change some settings on your Vercel dashboard.
2. Change your Node.js version on Vercel
To change your node version in Vercel first open your Vercel

After that navigate to your Project/settings/general/ Node.js version and you should see something that looks like this

Depending on your Node.js version change the version to what your local Version shows. Finally save your settings and redeploy.
2. Override the Build command
In order to do this get in your project settings and navigate to Build & Development Settings. Once you find it you should see something like this as your default:

Once you see this, toggle the override button then proceed to write the build command manually. If you’re not sure what your build command could be try these out depending on your package manager
- npm user: npm run build
- pnpm user: pnpm run build
- bun user: bun run build:release
Finally save and Redeploy your project.
3. Delete your eslint.config.mjs file
I would be lying if I told you I new the logic behind this but it just works
Doing this is pretty straight forward but all you have to do is navigate to your project folder on your local machine and find the eslint.config.js file in the root folder then delete it. Finally just push the changes you’ve made to your main repository and pronto your app should deploy fine!
⭐ Bonus Trick
Adding a VI Environment variable
CAUTION: I do not recommend this method as it may hide some Important errors so be sure to proceed at your own risk!
This has never worked for me before but a lot of people seem to have fixed their issue this way.
In order to do this you can use the Vercel CLI but for simplicity sake I’ll be doing this from the dashboard
First open your project settings then navigate to Environment Variables. you should see something like this if you didn’t add any environment variables beforehand :

Once your here type CI in the key input and set the Value to false . Once you’ve done that save your settings and redeploy your project.
The Last section of this article was inspired by this answer on stackoverflow if you want more information on whether you should use it in your project or not check it out.
And that’s it folks hope you learned something from this article !