CodeWithDanDockerServices
CodeWithDanDockerServices copied to clipboard
Error: Cannot find module 'express'
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
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.