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

'yarn link' for binary global install on Windows results in linked .js file but no .cmd #4772

Closed
mattnathan opened this issue Oct 24, 2017 · 1 comment · Fixed by #5524
Closed

Comments

@mattnathan
Copy link

mattnathan commented Oct 24, 2017

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

What is the current behavior?
yarn link within a project having "bin": {"something": "./index.js"} in the package.json results in a junction being created between \Users\<user>\AppData\Local\Yarn\bin\something and the file <project>\index.js. Unfortunately windows cannot run or does not see this file.

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

Run the following in CMD on Windows

> mkdir yarn-test
> cd yarn-test
> @echo {"name":"yarn-test","version":"1.0.0","license":"MIT","bin":{"boo":"./index.js"}}>package.json
> @echo console.log("Aargh");>index.js
> yarn link
yarn link v1.2.1
success Registered "yarn-test".
info You can now run `yarn link "yarn-test"` in the projects where you want to use this module and it will be used instead.
Done in 0.09s.
> boo
'boo' is not recognized as an internal or external command,
operable program or batch file.
> yarn global bin
C:\Users\<user>\AppData\Local\Yarn\bin
> dir C:\Users\<user>\AppData\Local\Yarn\bin\ | findstr boo
24/10/2017  16:42    <JUNCTION>     boo [C:\Users\<user>\AppData\Local\Yarn\config\link\yarn-test\index.js]

What is the expected behavior?
When yarn global adding a package you get a link and a CMD wrapper for us windows users, yarn link should do the same thing. For example:

> yarn global add yes
...
> yes
y
y
y
...
> dir C:\Users\<user>\AppData\Local\Yarn\bin\ | findstr yes
24/10/2017  16:55               350 yes
24/10/2017  16:55                58 yes.cmd

Please mention your node.js, yarn and operating system version.
yarn: 1.2.1
node: v8.5.0
Windows: Microsoft Windows [Version 10.0.15063]

@mattnathan mattnathan changed the title 'yarn link' for binary global install on Windows results in strange folder symlink to .js file 'yarn link' for binary global install on Windows results in linked .js file but no .cmd Nov 10, 2017
@calebboyd
Copy link

Also present in
yarn: 1.3.2
node: v8.9.3
Windows 10.0.16299

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

Successfully merging a pull request may close this issue.

3 participants