How to fix Error: Cannot find module './module-name' in Node.js

Node.jsBEGINNERMEDIUMUpdated Dec 9, 2025ยท 85 views

Occurs when using require() or import with relative paths (./ or ../) to modules that don't exist or have incorrect paths.

Quick fix

Fixes MODULE_NOT_FOUND

  1. Fix step 1
node.js โ€” error
# Error: Cannot find module './module-name'
Error: Cannot find module './module-name'

What this error means

Placeholder meaning for Cannot find module with relative path. This error needs detailed documentation.

Typical symptoms

  • Symptom 1
  • Symptom 2
  • Symptom 3

Common causes

  1. Cause 1
  2. Cause 2
  3. Cause 3

How to fix "Error: Cannot find module './module-name'"

1Fix step 1

Placeholder fix instructions

Advanced notes

Placeholder advanced notes.

Frequently asked questions

What does "MODULE_NOT_FOUND" mean?
Placeholder meaning for Cannot find module with relative path. This error needs detailed documentation.
How do I fix "MODULE_NOT_FOUND"?
Occurs when using require() or import with relative paths (./ or ../) to modules that don't exist or have incorrect paths.
What causes "MODULE_NOT_FOUND"?
Cause 1 Cause 2 Cause 3
Is the "MODULE_NOT_FOUND" error serious?
It is a medium-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading