oven-sh / bun

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

bun install & bun <script> works, bun run does not #6988

Open officiallymarky opened 1 year ago

officiallymarky commented 1 year ago

What version of Bun is running?

1.0.10

What platform is your computer?

Ubuntu 23.10

What steps can reproduce the bug?

index.js:
---
import * as hive from "@hiveio/hive-js"

hive.api.getAccounts(['hiveio'], function(err, result) {
     console.log(err, result);
});
---

bun run index.js

FAILURE: error: Cannot find package "bs58" from "/home/mal/.bun/install/cache/@hiveio/hive-js@2.0.7/lib/auth/ecc/src/address.js"

bun install @hiveio/hive-js

index.js:
---
import * as hive from "@hiveio/hive-js"

hive.api.getAccounts(['hiveio'], function(err, result) {
     console.log(err, result);
});
---

bun index.js

SUCCESS: Expected Result, no error.

What is the expected behavior?

bun run and bun install should be function similar when running code.

What do you see instead?

error: Cannot find package "bs58" from "/home/mal/.bun/install/cache/@hiveio/hive-js@2.0.7/lib/auth/ecc/src/address.js"

Additional information

If you install the modules, everything works fine. If you try to bun run and install the modules on the fly, it fails with a dependency error.

I wasn't sure if it was similar to issue 6986

Jarred-Sumner commented 11 months ago

This looks like a symlink related issue.