oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.35k stars 2.78k forks source link

Bun fails with packages that have no package.json #15285

Closed filmakarov closed 1 day ago

filmakarov commented 1 day ago

Some Solidity packages installed from github may have no package.json at all, as they have no dependecies. One example is this: https://github.com/Arachnid/solidity-stringutils

When it is used as dependency in a dependency, bun fails to bun i

Image

Can package.json be optional in such cases?

xhyrom commented 1 day ago

That's related to oven-sh/bun itself, not the GitHub action.


Does this even work with npm? I'm not sure but I think that package.json must be defined.

dylan-conway commented 1 day ago

This was implemented in bun v1.1.13 with #11644. Run bun upgrade to get the latest version of bun including this change.

If you add a git dependency from the cli without a name and the repo does not include a package.json with a name, Bun will choose the repo name as the dependency name.

bun add Arachnid/solidity-stringutils

package.json:

"dependencies": {
+     "solidity-stringutils": "Arachnid/solidity-stringutils"
}