Closed lecegues closed 8 months ago
This problem was inside our "FAQ" section in our GitHub wiki; however, we've decided to abolish that as GitHub issues is a better-centralized place to document common issues and solutions.
Solution: After switching to a branch that has different dependencies, rebuild the image using docker-compose build --no-cache <service-name>
. For example, if a dependency was added to the "backend" service (names specified in docker-compose.yaml), then the command would be docker-compose build --no-cache backend
This problem arises when going to another branch that has different dependencies. It seems that Docker will reuse the
node_modules
cache from the past branch, so any new, updated, or removed dependencies will not be reflected.Problem: Docker uses cache to reduce the time it takes to build and run containers. We believe that the
node_modules
folder is being reused rather than being updated