[node.js] "Failed to lookup view" when running project with WebStorm
Hi everyone,
I'm testing WebStorm and I would like to run my Node.js/Express project from WebStorm.
When I do that I get this weird error message :
Failed to lookup view "tunnel/description" in views directory "/Users/My/Projects/setup/controllers/views"
While it works from the command line NODE_ENV=development PORT=3000 node server.js
It doesn't from WebStorm with, what it looks like, the same configuration.
I found people having the same problem, but didn't understand any answer.
Do you have any idea?
Thanks.
Please sign in to leave a comment.
Please can you attach a sample project that shows up the issue?
Also, what OS are you on? Does the problem persists when you run WebStorm from terminal?
I attached a minimalist project to reproduce the behaviour.
I'm on Mac OS X Yosemite.
And I don't know how to run WebStorm from the terminal. Didn't find anything.
Thanks for your help.
Attachment(s):
jetbrains.zip
As expected, results are exactly the same for me when using WebStorm and terminal.
When I run 'node server.js' from the project root directory (setup), everything works as expected
When I run 'node full/path/to/server.js' from <project root>/controllers directory, I get 'Failed to lookup view "dashboard/index"'
Why do you try running your server with working directory set to '<project root>/controllers'?
No reason at all. A big mistake from me, didn't event see it.
Sorry for the inconvenience.
Thanks a lot Elena.