Skip to content
Latchkey

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.

remix
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

  1. Delete any stale cached node_modules restore and run a fresh install.
  2. Confirm all @remix-run/* packages are the same version.
  3. Re-run the build after the install completes.
Terminal
npm ci

Align every @remix-run version

Pin all Remix packages to one version so the resolver sees a consistent set.

Terminal
npm install @remix-run/node@2.9.2 @remix-run/react@2.9.2 @remix-run/serve@2.9.2

How to prevent it

  • Keep all @remix-run/* packages on the same version.
  • Use npm ci so CI installs the exact lockfile tree.
  • Avoid --production installs when the build needs dev packages.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →