CodeWithDanDockerServices icon indicating copy to clipboard operation
CodeWithDanDockerServices copied to clipboard

Error: Cannot find module 'express'

Open mobyforce opened this issue 9 years ago • 1 comments

HI Dan, thank you for the excellent tutorial on Docker.

I am getting the error 'Error: Cannot find module 'express'' when I try to run 'docker-compose up'. I added 'npm install -g express' in node-codeqwithdan.$app-env.dockerfile, it didn't help.

Please help.

Rafeeq

mobyforce avatar Jan 29 '17 14:01 mobyforce

Hi there! The Docker Compose file is setup for using containers with a volume that points to your local copy of the code. In the Dockerfile for Node it doesn't run npm install so you'll need to do that locally so that the node_modules folder shows up on your machine in the project.

DanWahlin avatar Jan 29 '17 14:01 DanWahlin