NPM Install Failing with EROFS in npm-debug.log on VirtualBox shared Drive [Updated for ETXTBSY]

I have a set up where I use my IDE on my host system and build my code on an Ubuntu server and deploy there.

To achieve this I have used virtual box to install and run Ubuntu as a guest system. My host system is Windows.  I have shared a drive across to the guest. Every time my ubuntu comes up, I mount the drive using the command:

sudo mount -t vboxsf SHARE_NAME folder_to_mount_on

Things were working fine, with my Java server development. Now I decided to move my js and node environment to the same set up and BOOM! it failed.

Only hint was EROFS error on the npm-debug.log. Some googling and I find out that VirtualBox has a bug and it does not support sysmlink and since ubuntu by default support symlink creation, npm was failing at the time of creation of sysmlink.

My initial solution was to write a build script which rsynced my working directory to a level above and run the build command there. I worked but was slow and hacky.

Then I found out that we can switch on symlink on VirtaulBox and windows: To do so:

VBoxManage setextradata YOURVMNAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/YOURSHAREFOLDERNAME 1

Verify by running:

VBoxManage getextradata YOURVMNAME enumerate

Restart VirualBox and run it as administrator, and things starts working :)

UPDATE:
Another new error I cam across in the similar environment was stack: 'Error: ETXTBSY, 
for this I have to end up adding  --no-bin-links so that no soft links are created.


Comments

Popular posts from this blog

Most expensive product on Amazon India By Category

8 Product Management lessons from the movie 'Gold'