Here is my complete error:
Error: Cannot find module \'ejs\'
at Function._resolveFilename (module.js:317:11)
at Function._load (module.js:262:25)
Install it locally rather installing it globally. Then your project may be run on any machine without any error.I think its better.
npm install express --save
npm install ejs --save
I have the same issue it resolve after installing the express in my project directory. previously i install it in global scope with -g option with npm install command.
I face same error for ejs, then i just run node install ejs
This will install ejs again.
and then also run npm install
to install node_modules again.
That's work for me.
Reinstalling npm, express and ejs fixed my problem
This one worked for me,
after that, the error was fixed.
I installed ejs
using command npm install ejs
in express directory level and this solved my problem.
i have install express using steps mention in express guide http://expressjs.com/guide.html
I installed both: express and ejs with the option --save:
npm install ejs --save npm install express --save
This way express and ejs are dependecies package.json file.