Remix "Cannot find module '@remix-run/...'" in CI
A @remix-run/* import failed to resolve at build or start. Either the package is not installed on the runner, its version is out of step with the rest of the Remix packages, or the wrong runtime package is referenced for the deploy target.
What this error means
The build or server start fails with "Error: Cannot find module '@remix-run/node'" (or /react, /serve, /dev) even though the app runs locally.
Error: Cannot find module '@remix-run/node'
Require stack:
- /home/runner/work/app/build/index.js
at Module._resolveFilename (node:internal/modules/cjs/loader)Common causes
Dependencies not installed on the runner
CI skipped or partially ran the install (a cache-only path, or --production dropping a needed package), so a @remix-run module is absent.
Mismatched @remix-run package versions
Remix requires every @remix-run/* package to share the same version. A drifted @remix-run/node vs @remix-run/react can fail to resolve or crash.
How to fix it
Clean install with the lockfile
- Delete any stale cached
node_modulesrestore and run a fresh install. - Confirm all
@remix-run/*packages are the same version. - Re-run the build after the install completes.
npm ciAlign every @remix-run version
Pin all Remix packages to one version so the resolver sees a consistent set.
npm install @remix-run/node@2.9.2 @remix-run/react@2.9.2 @remix-run/serve@2.9.2How to prevent it
- Keep all
@remix-run/*packages on the same version. - Use
npm ciso CI installs the exact lockfile tree. - Avoid
--productioninstalls when the build needs dev packages.