Persistent Cannot find module Errors on All New Builds

Hi everyone,
I’m facing a critical issue with a project where my production site is down, and I’ve exhausted all the troubleshooting steps I can think of. I’m hoping someone in the community might have encountered this before.
The Problem:
All new deployments for my Node.js/Express project are failing at runtime with Cannot find module ‘…’ errors. The build step itself reports as “successful” on the Vercel dashboard, but any attempt to hit an API endpoint results in a 500 error and a function crash.
The specific missing module changes with almost every deployment (e.g., ‘./common’, ‘./bulkWriteResult’), which strongly suggests the npm install process is getting corrupted on Vercel’s build servers.
Project Setup:
Stack: Node.js, Express.js, Mongoose, EJS.
Structure: The project has a two-package.json structure: a minimal one in the root, and the main one in the /api directory where the serverless function lives.
Key Facts & Timeline:
The main branch was deploying and running perfectly for a long time.
The issue started immediately after I added new environment variables via the Vercel dashboard, which triggered a new production deployment.
Since that moment, every new deployment to main fails at runtime.
An old deployment of a different branch is still live and working correctly, which proves the core application code is valid.
The application runs perfectly locally.
Troubleshooting Steps I’ve Already Taken:
I created a brand new preview branch (store-preview) as an exact copy of main. This new branch also fails with the exact same error, proving the issue is now project-wide and affects all new builds, not just the main branch environment.
I have tried redeploying multiple times with the build cache cleared via the UI button on every attempt.
Running vercel build using the Vercel CLI on my local machine succeeds without any errors.
I’ve inspected my project settings and found a Build Command override (npm run build) that doesn’t correspond to a script in my package.json, which seems like a major misconfiguration.
I have already opened a support ticket with Vercel, but am hoping the community might have some additional insights.
My Core Question:
Has anyone ever encountered a situation where Vercel’s npm install process seems to get permanently corrupted for an entire project, affecting both production and all new preview builds? Is there a known cause for this, or a way to force a “deeper” reset of the build environment beyond what’s available to us?
Any help or ideas would be hugely appreciated. Thank you!

If you’re having trouble deploying an Express app, this guide can help.

You can also ask v0 for suggestions tailored to your own project setup.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.