I'm now trying to use a Linux VM sharing the same Windows filesystem. It's not clear to me exactly what my constraints will be here. When I just tried to navigate into a project directory that has an existing "node_modules" tree (which was installed on Windows) and run a build, it fails to find karma. At that point, I manually patched my PATH to find the "karma" script in the "node_modules" tree in my current directory. When I ran the build again, it then failed to start PhantomJS, although it doesn't say why.
What sorts of problems might I be having here? Is it possible to share the "node_modules" tree between the two platforms?
it is surprisingly not that safe to share node_modules trees between platform.
For example, Karma uses PhantomJS which is a binary executable (not portable) and also uses socket.io which in turn uses ws which uses a compiled addon (not portable).
One problem I've seen with node running in a linux vm off of the host filesystem is that VirtualBox (and probably most virtualization software) disables symlinks on the shared filesystem for security reasons. npm uses symlinks when installing(probably to prevent duplicating files of the same module version.)
If that is the problem, you can solve this by either installing the modules without symlinks (check the npm manual for the correct switch) or allow symlinks in your host virtualization software (depends on the software).
Sorry for top posting, sent from my phone.
> For example, Karma uses PhantomJS which is a binary executable (not
> portable) and also uses socket.io which in turn uses ws which uses a
> compiled addon (not portable).
That would be a problem too. I wasn't actually using/installing the
modules from windows in my case, they were just stored there for
persistence between VMs. That's good to know.
> portable) and also uses socket.io which in turn uses ws which uses a
> compiled addon (not portable).
That would be a problem too. I wasn't actually using/installing the
modules from windows in my case, they were just stored there for
persistence between VMs. That's good to know.
댓글 없음:
댓글 쓰기