Error fix

How to fix “Cannot find module (Node / bundler)

The runtime or bundler could not resolve an import—missing package, wrong path, or build config.

Updated Apr 20, 2026

Fastest fix

Start here first. Step 1 fixes most cases—then work down the list.

  1. Install the package or fix the import path to match published exports.
  2. Align extensions (.js vs .ts) with moduleResolution and bundler targets.
  3. In monorepos, verify workspace protocol and symlinked packages.

What this means

Node or your bundler looked up a module specifier and failed—either nothing is installed, paths don’t match, or resolution rules differ between dev and prod.

Common causes

  • Missing dependency

    Package not installed, workspace not linked, or optional dep skipped.

  • Path aliases

    tsconfig paths not mirrored in the bundler or Jest config.

Step-by-step fix

  1. Restore resolution

    1. Install the package or fix the import path to match published exports.
    2. Align extensions (.js vs .ts) with moduleResolution and bundler targets.
    3. In monorepos, verify workspace protocol and symlinked packages.

FAQ

Works locally, fails in CI?
Check frozen lockfiles, NODE_ENV, and that devDependencies are installed when needed.
ESM vs CJS?
Use import/require consistent with package.json type and "exports" field.
Next.js module not found?
Server vs client components affect what can be imported—check "use client" boundaries.

Still stuck? Try these related fixes next.

Edit your error

Tweak the message and run again—we'll match an existing fix or generate a new page.

Original error message
Error: Cannot find module 'lodash'
Fix another errorHTTP status codesURL status checkerRedirect checkerAll tools