Please follow this reasoning and tell me where I am wrong.
- I want to develop a web app with Typescript. This is the folder structure:
src
- index.ts
package.json
tsconfig.json
- I want to compile and run the app inside a container so that is not environment-dependent. 
- I run - docker build --name my_imagewith the following- Dockerfilein order to create an image:
FROM node:16
WORKDIR /app
COPY package.json /app
RUN npm install
CMD ["npx", "dev"]
- This will create a - node_modulesfolder inside the container.
- Now I create a container like so: 
docker create -v $(pwd)/src/:/app/src my_image --name my_container
- I created a volume so that when I change files in my host - /srcI will change also the same files in the container.
- I start the container like so: 
docker start -i my_container
- Now everything is working. The problem, though, are the linters. 
- When I open a file with my text editor from the host machine in - /srcthe linter are not working because there is no- node_modulesinstalled on the host.
If I npm install also on the host machine I will have 2 different node_modules installation and there might be some compilation that differ between the host and the container.
Is there a way to point the host node_modules to the container node_modules?
If I create a docker volume for node_modules like so
docker create -v $(pwd)/node_modules:/app/node_modules ...
I will delete all the compilation done in the container.
What am I doing wrong?
Thank you.
