Yarn: Feature Request: NPM --no-bin-links

Created on 12 Oct 2016  路  7Comments  路  Source: yarnpkg/yarn

Host OS: Windows 10
Guest OS: Fedora 24
Hypervisor: VirtualBox 5.1.6

When running yarn install inside a VirtualBox Shared Folder, it will fail with an error similar to the following:

$ yarn install
yarn install v0.15.0
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
error EPROTO: protocol error, symlink '../../../handlebars/bin/handlebars' -> '/home/vagrant/sync/node_modules/express-handlebars/node_modules/.bin/handlebars'
    at Error (native)
info Visit http://yarnpkg.com/en/docs/cli/install for documentation about this command.

Even though the Linux guest supports symlinks, they are unsupported inside VirtualBox Shared Folders.

$ mount |grep vboxsf
home_vagrant_sync on /home/vagrant/sync type vboxsf (rw,nodev,relatime)
home_vagrant_sync on /home/vagrant/sync type vboxsf (rw,nodev,relatime)
$ cd /home/vagrant/sync
$ mkdir a
$ ln -s a b
ln: failed to create symbolic link 'b': Protocol error

Npm supports the --no-bin-links option to avoid using symlinks (which makes things slower but more reliable in this situation).

To be clear, this is not an issue in Npm or Yarn but a deficiency in VirtualBox (that was supposed to be fixed but has resurfaced).

Most helpful comment

this is a blocker for me with a vm on windows

All 7 comments

this is a blocker for me with a vm on windows

facing the same issue ubuntu vm on Windows host I bypass the problem with --no-bin-links when using npm. yarn fails with:

Trace: Error: EROFS: read-only file system, symlink '../../../coffee-script/bin/coffee' -> '/media/sf_public/project_folder/node_modules/grunt/node_modules/.bin/coffee' at Error (native)

Please use GitHub reactions and not add noise with +1's as comments, thank you!

Created #1651 to fix this, pending approval.

is there a way to set this option in .yarnrc?

@kittens I'm using latest yarn on an ubuntu 14.04 docker image running under Windows 10 Home on VirtualBox. I think I'm facing a similar issue:

sketch

Running a normal npm install passes without any hiccups though.

EDIT: I'm sorry, I missed out on your comment about about using --no-bin-links flag with yarn install. It works well with that flag enabled. 馃憤

I still get this problem. I spawn a child_process and run the following command

bash /var/task/node_modules/yarn/bin/yarn install --no-bin-links

And I still get the error

Trace:
  Error: EROFS: read-only file system, mkdir '/home/sbx_user1059'
      at Error (native)

I also tried

bash /var/task/node_modules/yarn/bin/yarn install --no-bin-links --cache-folder /var/local

and I get the same error

Any suggestions?

Was this page helpful?
0 / 5 - 0 ratings