VirtualBox mounted folders do not allow for the creation of symlinks, so if you try to run npm install you will get a wall of errors a mile long. Good news though, there a couple of solutions!

  • npm install --no-bin-links - Tell npm not to use symlinks. Don’t know what kind of weirdness this does. Probably some incredible inefficiency of space use. Some npm packages (gulp-jsdoc) still failed when using this.
  • Tell VirtualBox to allow symlinks for your particular shared folder - documented more here. The command is VBoxManage setextradata YOURVMNAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/YOURSHAREFOLDERNAME 1. You need to restart virtualbox to get this to start working. I did this and it worked for me.

These answers came from this SO question