Docker For Windows Volume Disconnects From Container

I’m using Docker for Windows to develop a Node.js application. I use VS Code’s Remote - Containers extension. I have a named volume connected to the container for my node_modules. After my container is up and running I start nodemon to begin developing - everything works fine. But when I stop nodemon the node_modules disappear from inside the container. I can stop the container and start it again and everything works fine until I start and stop nodemon again. Has anyone experienced this before or understand why this would happen?

This issue happens with “tsc -w” as well. I think whatever the file watchers (tsc or nodemon) are emitting, Docker responds by disconnecting the volume. If anyone has an idea of what’s happening, please help! Thank you.

It’s not just file watchers. I simply ran “tsc” to build the JS files and the node_modules disappeared. I’m going to resort to just installing all my node_modules on the bind mount for my source code.

I have factory reset Docker but to no avail. The issue persists.

Docker Desktop Version: 2.1.0.0
Windows 10 Enterprise: Version 1809