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

Installing a package with bin that points to .exe file fails on Windows #5159

Closed
kamsar opened this issue Aug 4, 2022 · 1 comment
Closed
Assignees

Comments

@kamsar
Copy link
Member

kamsar commented Aug 4, 2022

pnpm version: 7.8.0

Code to reproduce the issue:

npm init -y
pnpm i hasura-cli

Expected behavior:

pnpm hasura version should work after installing the package (this works fine with npm)

Actual behavior:

 WARN  Failed to create bin at C:\<snip>\node_modules\.bin\hasura. The source file at C:\<snip>\node_modules\hasura-cli\hasura does not exist.


This occurs because the package's bin field points at ./hasura (https://github.com/jjangga0214/hasura-cli/blob/603dc24afccc5aa027260b7da8f64c8787a6d19c/package.json#L97), but it downloads a binary that on Windows is named hasura.exe. npm writes a batch file to node_modules/.bin which gets the .exe implicitly added, but pnpm does not.

I'm not sure if this is considered a bug or a feature. I can look into a PR if a fix is welcome.

Additional information:

  • node -v prints: 16.14.0
  • Windows, macOS, or Linux?: Windows 11
@zkochan
Copy link
Member

zkochan commented Aug 6, 2022

I guess we need to update https://github.com/pnpm/cmd-shim to search for a .exe file on Windows, if the exact file from bin doesn't exist.

@zkochan zkochan self-assigned this Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants