Skip to content

Yarn under Git Bash replaces forward slash in package name with escaped backslash #2785

Closed
@mcavanagh

Description

@mcavanagh

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

What is the current behavior?
When trying to add a package with a forward slash in the name using Git Bash (MinGW terminal), the forward slash is replaced by 2 backslashes

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

  • Run yarn under the Git Bash terminal emulator on Windows 10.
  • Try to add a package with a forward slash in the name. Eg: yarn add @types/rx
  • Yarn tries the package name "@types\\rx" instead of "@types/rx". This happens with yarn add and yarn remove

yarn-add-error

What is the expected behavior?
The package should be successfully installed and added to the manifest.
It works successfully either by using 'npm install' in git bash, or by using the default Windows 'cmd' shell with yarn.
It feels like there's some OS-specific path separator escaping going on, rather than treating the package name purely as a string. I've tried enclosing it in quotes, but this made no difference.

Please mention your node.js, yarn and operating system version.
Node v7.6.0
Yarn v0.20.3
OS: Windows 10 v1607 (Build 14393.693)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions