Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: NPM --no-bin-links #929

Closed
gtirloni opened this issue Oct 12, 2016 · 7 comments
Closed

Feature Request: NPM --no-bin-links #929

gtirloni opened this issue Oct 12, 2016 · 7 comments

Comments

@gtirloni
Copy link

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).

@jblotus
Copy link

jblotus commented Oct 14, 2016

this is a blocker for me with a vm on windows

@kyriakos
Copy link

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)

@wyze
Copy link
Member

wyze commented Oct 26, 2016

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

@sebmck
Copy link
Contributor

sebmck commented Nov 3, 2016

Created #1651 to fix this, pending approval.

@sebmck sebmck closed this as completed Nov 3, 2016
@sebmck sebmck removed the cat-feature label Nov 3, 2016
sebmck pushed a commit that referenced this issue Nov 3, 2016
Jessidhia pushed a commit to Jessidhia/yarn that referenced this issue Nov 4, 2016
* master: (66 commits)
  Add --no-bin-links flag - fixes yarnpkg#929 (yarnpkg#1651)
  Add option to change the prefix of the global bin folder - fixes yarnpkg#630 (yarnpkg#1654)
  patterns -> filteredPatterns
  Add helpful nudge to yarnpkg/rfcs on issue template (yarnpkg#1650)
  Change reporter.log to console.log in generate-lock-entry command - fixes yarnpkg#644 (yarnpkg#1652)
  Fixed add command flag (yarnpkg#1653)
  Nested executables fix (yarnpkg#1210)
  Added short-flags for yarn add (yarnpkg#1618)
  Add name lookups to ls command - fixes yarnpkg#1599 (yarnpkg#1643)
  Disable flaky secureUrl test (yarnpkg#1644)
  Add unit tests for `yarn why`. (yarnpkg#1544)
  Refine flow type for config.generateHardModulePath (yarnpkg#1642)
  Use ~/Library/Caches as default cache location on OSX - fixes yarnpkg#1637 (yarnpkg#1638)
  Update aliases.js (yarnpkg#1635)
  Update aliases.js (yarnpkg#1634)
  Add webhook to archive AppVeyor build artifacts (yarnpkg#1631)
  Attempt to fix failing Circle CI builds (yarnpkg#1629)
  Adding 'yarn global upgrade'(Issue yarnpkg#776) (yarnpkg#1616)
  Show error message in stdout. (yarnpkg#1502)
  Nicer permission errors when trying to write global binaries - fixes yarnpkg#1578 (yarnpkg#1592)
  ...
@heldchen
Copy link

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

@kumarharsh
Copy link

kumarharsh commented Jan 19, 2017

@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. 👍

@ktalebian
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants