-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find module EJS #910
Comments
if you can |
hmm it kinda looks like it's using a globally installed express.. |
It's a bit strange - I've tried requiring EJS from my app.js file and although it's in the main node_modules folder the require now fails as soon as the app starts. Moving EJS back out to a node_modules a level above my app.js fixes it. This is on a new machine so I haven't installed Express or EJS globally. |
looks global to me "/Users/shamoon/local/node/lib/node_modules/express" |
that should be "/Users/shamoon/Sites/soldhere.in/node_modules/express" |
Oh yeah I see what you mean - that's not the error I submitted on stackoverflow, that was someone else who seemed to be having the same problem. Here's my stack trace: |
One point I've just thought of that may be applicable - I'm mounting a second Express app (api) within a main Express app (site) |
hmm yeah that might have something to do with it, bottom-line is that if you can require() it in that app, express can get it, so that's definitely the first thing to resolve |
Just a note: I've got: require('ejs') and app.set('view engine', 'ejs') - and I still get this error. For me, it was having a globally installed express. global express + any kind of ejs resulted in the module not being found when using render(). Locally installed both seemed to work. |
This issue has been inactive for over 4 months so I'm closing it. If you think it's still an issue re-open.
|
Open a new issues with complete information so we can better assist you. This issue is 6 years old and Express and things like ejs have changed a fair bit in that time. |
I'm getting the 'Cannot find module EJS' error when trying to render a page.
Installing EJS globally, or installing it a level above my app.js file fixes this issue. Here is a stackoverflow question from someone else who had the problem:
http://stackoverflow.com/questions/7754799/error-cannot-find-module-ejs
The text was updated successfully, but these errors were encountered: