Using Vagrant with npm-dependent dependencies

I evaluate changes in the development process in Vagrant , but I often develop interdependent, not yet released Node modules that are linked together by npm link .

Since Vagrant does not have all the source files shared on the guest machine, creating npm link symlinks is not enough to create these modules synchronously with each other. Firstly, there is no way to get npm link to create hard links. For two, sharing the symbolic link assignments on the a la board, the following will not scale:

 config.vm.synced_folder "/usr/local/share/npm/lib/node_modules", "/usr/lib/node_modules" 

Now, the question. Is any of the above errors (e.g. npm support for hard links exist, and I skipped this)? What processes do people use to develop interconnected private Node modules with validation done through Vagrant?

EDIT: Ultimately, I hope for a solution that will work on both Mac and Windows. In addition, for the record, I do not intend to think about how the complex layout of the Node module will work; I'm just trying to use Vagrant to improve this non-unusual workflow.

+7
windows posix vagrant npm
source share
1 answer

Idea: Instead of using the VM synchronization function, use the shared service in the virtual machine to make the files accessible from the host OS.

For example, if your virtual machine is running Linux and the host OS is Windows, you can run samba and configure it to share the corresponding directories. Then, if the OS host displays the samba share.

If the host OS is Mac, you can use something like macfuse to mount the directory via SSH to the virtual machine.

Good luck

+1
source share

All Articles