Skip to content

Yarn on Windows creates invalid junctions to files (junctions are not allowed to files, only directories) #6450

@AlexVallat

Description

@AlexVallat

Do you want to request a feature or report a bug?
Reporting a bug, on Windows, which Yarn has that npm does not.

What is the current behavior?
Yarn will create a junction to a file, which is not allowed (ref: docs.microsoft.com. This causes problems for anything that enumerates files under the node_modules tree, which will crash out with a 0x8007010b: Directory Name Invalid error.

If the current behavior is a bug, please provide the steps to reproduce.
yarn add acorn (for example)
Look in node_modules\acorn\.bin\, note the presence of a junction to ...Yarn\Cache\v3\npm-acorn-6.0.2-6a459041c320ab17592c6317abbfdf4bbaa98ca4\node_modules\acorn\bin\acorn
Note also that this acorn is a file, not a folder.

If you look at the node_modules\acorn\.bin folder in windows explorer, acorn is shown as a shortcut to a folder, and double clicking on it results in the error "The filename, directory name, or volume label syntax is incorrect."

Note that with npm, there is no .bin folder in node_modules\acorn\, and no invalid junction.

What is the expected behavior?
If there has to be a link to a file, it should be a symlink, and not a junction.

Please mention your node.js, yarn and operating system version.
Node.js: 8.11.2
Yarn: 1.11.0
OS: Windows 7

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions