Monday, March 19, 2012

node.js: Error: Cannot find module 'express'

To resolve the error of title.
Move to root folder of express project. And install "npm install express ejs" again.
In the result, express module directory is created at folder "node_modules".
Other way, if you install express, already there is the express directory at your machine.
So please connect node_path to that directory.


2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. As explained on my blog: Error can not find module problem can be fixed with making sure that environment parameter NODE_PATH is set properly.

    export NODE_PATH="C:\Users\IMarek\AppData\Roaming\npm\node_modules"

    ReplyDelete