bun icon indicating copy to clipboard operation
bun copied to clipboard

bun install doesn't work while other do

Open ndaidong opened this issue 3 years ago • 2 comments

Version

0.1.11

Platform

Linux msi14a10rb 5.19.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 15 Sep 2022 16:08:26 +0000 x86_64 GNU/Linux

What steps will reproduce the bug?

I create a simple package as example for my library.

When I try to install dependencies with bun install, the process finishes as well, but I can not start with bun run. There is always some error with one of the dependencies.

If I remove all downloaded modules by bun, and reinstall with npm or pnpm or `yarn, everything works like a charm.

Screenshot from 2022-09-17 22-49-20

How often does it reproduce? Is there a required condition?

Always.

What is the expected behavior?

The standard steps must work:

bun install
bun run index.js

What do you see instead?

error: Could not resolve: "hono". Maybe you need to "bun install"?
import { Hono } from 'hono'
                     ^
/workspace/experiments/bun-article-parser/index.ts:1:22 21

Additional information

The above error occurs on my laptop, which runs EndeavourOS (Arch based), Gnome 42.

I've checked with my server (debian 11) and got the same problem.

Linux debian-hel 5.10.0-17-amd64 #1 SMP Debian 5.10.136-1 (2022-08-13) x86_64 GNU/Linux

It seems relate to the symlink between downloaded nodejs packages stored at ~/.bun/install/cache folder and local node_modules.

ndaidong avatar Sep 17 '22 16:09 ndaidong

I'm not sure what the cause is here. Can you:

  1. Try again with bun v0.1.12
  2. If that doesn't work, try bun install --backend=copyfile

Can you also find out what filesystem you're using? I wonder if there is some subtlety with hardlinks there.

I'm not able to repro this. I am able to use hono successfully after bun install on my local machine on both linux and macOS.

Jarred-Sumner avatar Sep 18 '22 07:09 Jarred-Sumner

@Jarred-Sumner thank you for help, bun install --backend=copyfile works for me. I tried several times and it's always success. My filesystem is ext4.

ndaidong avatar Sep 18 '22 16:09 ndaidong

Workaround is to use:

bun install --backend=copyfile

We're tracking this issue here: #362

Electroid avatar Nov 03 '22 01:11 Electroid