Open jdion84 opened 1 year ago
Same issue.
From my case, error: missing script XXXXX
is printed.
I believe this is MacOS specific bug.
Yeah. Same thing, on Mac too. I guess, bun link ...
simply doesn't register your project to bash commands as Node does.
I guess, as a temporary solution you could link it with Node.js using npm link
, and add #!/usr/bin/env bun
inside of your JS (or TS) runtime file. That's stupid, but probably it'll work.
I did some researches and realised that the fix is so easy:
You should use string as a bin
value, not object, so instead of this:
{
"name": "bunclitest",
"module": "index.ts",
"type": "module",
"bin": {
"bunclitest": "bin.js"
}
}
do like this:
{
"name": "bunclitest",
"module": "index.ts",
"type": "module",
"bin": "bin.js"
}
You should use string as a bin value, not object
no, you shouldnt
You should use string as a bin value, not object
no, you shouldnt
Well, in my situation that's fixed the problem. It doesn't work with object on my and these peoples machines for some reasons.
bin commands still not working with bun linked packages as of version 1.18
I figured this out
after you add the bin to the local package, just do bun link
on it again
If you install bun via homebrew and do nothing else is not going to work. Installing via curl -fsSL https://bun.sh/install | bash
solve the problem
What version of Bun is running?
1.0.0+822a00c4d508b54f650933a73ca5f4a3af9a7983
What platform is your computer?
Darwin 22.6.0 arm64 arm
What steps can reproduce the bug?
create file
my_modules/bunclitest/package.json
:create file
my_modules/bunclitest/bin.js
:open
my_modules
dir in terminal and runbun link
open project root folder and run
bun link bunclitest --save
run
bunx myclitest
nothing is outputted to console.
What is the expected behavior?
hello bin
should be outputted to console when runningbunx bunclitest
What do you see instead?
nothing
Additional information
No response