[5.0.2 regression]: bin is broken?
AviVahl opened this issue ยท 2 comments
AviVahl commented
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 commented
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 commented
Thank you for the very prompt fix! ๐