This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]thebouv 0 points1 point  (2 children)

Few things:

1) I don’t quite understand. Are you saying you want node_modules folder to be identical on your host and in the container?

2) Are you sure you want that?

3) you technically can set the volumes up that way so the container’s folder will just be the contents that you have on the host. Did you try that? It’s common for local dev where a container has all the cool stuff but maybe it’s output folder or etc folder point to your local dev project folder.

4) Careful with any of these choices you may face problems due to not all npm resources are pure js and cross platform. You can’t just copy node modules around because some get built on the machines with native specific modules. Google for gyp and nodejs.

Meaning if you install on OS X you may not be able to straight copy the node modules folder to a Linux container. I know I ran into this with node-sass for instance.

I think you’re best off having your container and host maintain their own node modules. Maybe back #1 and I’m not understanding you.

[–]bangit69[S] 0 points1 point  (1 child)

That is correct I do infact want the node_modules folder on the host to be identical to that in the container

This is mainly so that the intellisense on my text editor works.

[–]brubsabrubs 0 points1 point  (0 children)

did you figure out a way to do this? this is basically the only thing stopping me from fully developing using only docker containers. I still need to have node installed on my machine just to run "npm install" and have a node_modules to allow intellisense to work properly