← All errors · Replit

Error: Cannot find module 'express'

Exact error

Error: Cannot find module 'express'
Require stack: ...  code: 'MODULE_NOT_FOUND'

What it means

Node can't find a package (or local file) you required.

Likely causes

How to fix it

  1. Install and save the dependency:

    npm install express
  2. For a local file, check the relative path, e.g. require('./routes/users') from the right directory.

Related errors

Get new fixes weekly

No spam. Unsubscribe anytime. Privacy