0

I'm developing a web application on Red Hat's OpenShift platform and I would like to use WebStorm (by JetBrains) as an IDE.

I've got Node.js and npm installed on my machine and I've been able to run Node.js applications with my computer in the past. However when I pull the application from OpenShift and run server.js from within WebStorm, I get the error message Error: Cannot find module 'express'.

I want to be able to run and debug my Node.js application on my computer before pushing it to live. Is there a way to do this?

Robin Newhouse
  • 2,158
  • 2
  • 19
  • 17
  • I just tried executing `node server.js` in the command line with the same results. Perhaps openshift applications cannot be run locally? that's a bummer. – Robin Newhouse Oct 14 '15 at 18:14

1 Answers1

0

Well I seem to have answered my own issue. I found the solution in the Node.js Error: Cannot find module express

I just ran npm install express from my application's root directory and it ran fine on the command line and WebStorm.

It seems that I needed to install express locally to my application. OpenShift must have express running on its server that obviously wouldn't copy through git.

Community
  • 1
  • 1
Robin Newhouse
  • 2,158
  • 2
  • 19
  • 17