Yarn: --no-bin-links options skip the .bin folder creation

Created on 26 Oct 2017  路  6Comments  路  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?
bug

What is the current behavior?
yarn install --no-bin-links skip the creation of the node_modules/.bin folder

This broke the installation and prevent usage of CLI command in yarn scripts. Our current workaround is to install globally the dependencies for which we need the CLI commands, but this is a wrong solution.

What is the expected behavior?
.bin folder should be created, with copied files. This is the behaviour on Window without the --no-bin-links flag.

This is essential to be able to use yarn inside a VM, where you need --no-bin-links, but don't want to lost functionalities.

Please mention your node.js, yarn and operating system version.
node 8.6.0
yarn 1.2.1.
Window 10 / Ubuntu 14.04 through Vagrant on Window 10.

Most helpful comment

Yep, that's a problem - "--no-bin-links" is needed on Windows inside e.g. a Vagrant VM since Symlinks don't really work there

All 6 comments

Same behavior in my environment:

  • node v6.11.3
  • yarn 1.3.2
  • CentOs 7.4.1708 (Core) through Vagrant on Windows 10

I have the same issue. I am using Docker Toolbox on Windows 10, sharing the node_modules on the Docker host (Windows) as a volume in the Docker container, to facilitate caching.

Yep, that's a problem - "--no-bin-links" is needed on Windows inside e.g. a Vagrant VM since Symlinks don't really work there

Did someone came up with a better solution than installing modules globally?
I tried to use their full path directly in yarn scripts but then I get permission errors like:

$ yarn ./node_modules/lerna bootstrap
/bin/sh: ./node_modules/lerna: Permission denied

even setting node_modules permissions to 777

Ok for those looking for an alternative solution, I made it work.
You must run your command with node prefix.
$ yarn node ./node_modules/lerna/bin/lerna.js bootstrap

The problem arises when you have postinstall scripts in certain libraries that make use of these symlinks and/or the .bin folder.

Was this page helpful?
0 / 5 - 0 ratings