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

[5.0.2 regression]: bin is broken? #288

Closed
AviVahl opened this issue Sep 25, 2023 · 2 comments
Closed

[5.0.2 regression]: bin is broken? #288

AviVahl opened this issue Sep 25, 2023 · 2 comments

Comments

@AviVahl
Copy link

AviVahl commented Sep 25, 2023

Noticed calls to rimraf are no-op. Even --help.

mkdir rimraf-test
cd rimraf-test
npm init -y
npm i rimraf -D
npx rimraf --help
<nothing>

Interesting part: directly calling node node_modules/rimraf/dist/esm/bin.mjs --help works.
I'm guessing it's a file mode thingy. If the mjs is generated, npm i didn't get to set its mode, like it does for bin entrypoints.
Possible fix, create a static bin entry that imports that file. e.g. https://github.com/wixplosives/pleb/blob/main/bin/pleb.js (see that GitHub says "executable file")

@isaacs isaacs closed this as completed in 14a1406 Sep 25, 2023
@isaacs
Copy link
Owner

isaacs commented Sep 25, 2023

Not file mode, was detecting main-module status incorrectly.

I could have sworn that node realpath'ed argv[1], but I guess it doesn't do that anymore, or my brain is just lying about history, it does do that sometimes.

@fwouts
Copy link

fwouts commented Sep 26, 2023

Thank you for the very prompt fix! 🎉

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

No branches or pull requests

3 participants