Skip to content

Windows & Git Bash: yarn run fails due to missing slashes #7732

@oturpe

Description

@oturpe

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

What is the current behavior?
Under Windows, when using Git Bash as the script-shell, attempts to run executables from node_modules/.bin using the yarn <executable> syntax fail due to path corruption.

If the current behavior is a bug, please provide the steps to reproduce.

  1. Clone the following repository: https://github.com/oturpe/yarn-run-bug
  2. Install dependencies with yarn
  3. Try to run an executable installed in node_modules/.binwith yarn eslint
  4. Observe execution fails due to the path corruption like this:
PS C:\ws\Testit\NodeJs\yarn-run> yarn eslint
yarn run v1.21.0
$ C:\ws\Testit\NodeJs\yarn-run\node_modules\.bin\eslint
/usr/bin/bash: C:wsTestitNodeJsyarn-runnode_modules.bineslint: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

What is the expected behavior?
Path is translated successfully and yarn eslint is run.

Please mention your node.js, yarn and operating system version.
NodeJs: 12.13.1
Yarn: 1.21.0
Operating system: Microsoft Windows [Version 10.0.18363.476]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions