[Node.js] How to resolve Error: Cannot find module 'express'

Tadashi Shigeoka ·  Sat, December 15, 2012

I’ll introduce how to resolve the “Error: Cannot find module ‘express’” error when Express is already installed in Node.js.

Express.js

Error: Cannot find module 'express' Error Details

% node-dev app.js

 [ERROR] Error
Error: Cannot find module 'express'
    at Function._resolveFilename (module.js:337:11)
    at Function._load (module.js:279:25)
    at Module.require (module.js:359:17)
    at require (module.js:375:17)
    at Object. (/Users/your_username/git/sampleapp/app.js:5:15)
    at Module._compile (module.js:446:26)
    at Object..js (module.js:464:10)
    at Object..js (/Users/your_username/.nvm/v0.6.21/lib/node_modules/node-dev/wrapper.js:121:14)
    at Module.load (module.js:353:31)
    at Function._load (module.js:311:12)

How to resolve Error: Cannot find module 'express'

You need to install including dependencies.

npm install -d

That’s all from the Gemba.