Skip to content

Instantly share code, notes, and snippets.

@ryanwr
Last active February 6, 2016 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanwr/199fd1d3da02f9dfdbe5 to your computer and use it in GitHub Desktop.
Save ryanwr/199fd1d3da02f9dfdbe5 to your computer and use it in GitHub Desktop.
Using NPM inside a VirtualBox shared folder
Installing a popular build tool such as grunt or gulp on a virtualbox share and a Windows host will cause issues due to Windows not being able to deal with long path names. Below is a solution to install node modules to an internal location rather than the virtualbox share.
Note: In npm 3 this should be a non-issue as it deals with nested dependencies better
"We found that mounting the node_modules folder instead of making a symlinc was a better solution,
but not the easiest one to work with, because mount folders does not persist after VM shutdown."
Source: https://github.com/fideloper/Vaprobash/issues/183
### Bind local folder to node_modules
cd /shared_workspace/project
sudo mount -o bind ~/node_modules node_modules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment