I’m hosting my website on Netlify, and recently, my builds started failing with the error Command failed with exit code 1. The issue appeared after I added some new dependencies to my project.
Here’s my setup:
Framework: React with Vite
Build command: npm run build
Publish directory: dist/
What I’ve observed:
The build works perfectly on my local machine.
The Netlify build log shows this error: Error: Command failed with exit code 1: npm run build
There are warnings about missing peer dependencies, but I’m not sure if they’re related to the failure.
What I’ve tried so far:
Cleared the build cache in Netlify and retried the deployment.
Ensured all dependencies are correctly listed in package.json.
Upgraded Node.js and npm versions in the Netlify build settings to match my local environment.
Ran npm ci locally to confirm there are no dependency conflicts.
Questions I have:
How can I debug the build failure further? Are there specific logs I should check on Netlify?
Could the missing peer dependencies be causing the problem, and if so, how should I resolve them?
Is there a better way to ensure my local and Netlify environments match exactly?
I’d really appreciate any guidance or tips to resolve this issue. Thanks in advance!
Thank you for your response and the links to the troubleshooting guides. I’ll review those resources to see if they provide any insights. If you could take a look at the deploy logs and provide any additional information or suggestions, that would be greatly appreciated. Meanwhile, I’ll continue exploring the build logs and other recommendations in the support guides. Thanks again for your assistance!