CorpGlory / express-webpack-example

Repo showing how to bundle an express.js application to a bundle with webpack
MIT License
8 stars 4 forks source link

Error: Cannot find module 'ejs' #1

Open julia-bougaev-bp opened 4 years ago

julia-bougaev-bp commented 4 years ago

I get Error: Cannot find module 'ejs' when running app.js file (which is compiled for production) and navigate to /template route. Could you please suggest what to do in this case?

rozetko commented 4 years ago

Hi, @julia-bougaev-bp.

I tried to reproduce it with the following steps:

npm install
npm run build
mkdir ~/test
mv dist ~/test
mv template.ejs ~/test
cd ~/test/dist
node app.js

Then I opened http://localhost:3000/template in browser and everything works.

Please specify: