bun icon indicating copy to clipboard operation
bun copied to clipboard

windows temp path is wrongly recognized (bunx)

Open anemochore opened this issue 6 months ago • 3 comments

What version of Bun is running?

1.1.21+70ca2b76c

What platform is your computer?

Microsoft Windows NT 10.0.22621.0 x64

What steps can reproduce the bug?

I'm using Win 11, and I've installed Bun (1.1.21). When I run bun repl, the error occurs and it won't run:

error: Module not found "d:\Temp\bunx-1558969007-bun-repl@latest\node_modules\..\..\..\..\D:\Temp\bunx-1558969007-bun-repl@latest\node_modules\bun-repl\src\cli.ts"

My %TEMP% is d:\Temp. Obviously, bunx tries to mix relative and absolute paths wrongly. Other example:

> bunx --bun cross-env FOO=1 echo hi
error: Module not found "d:\Temp\bunx-1558969007-cross-env@latest\node_modules\..\..\..\..\D:\Temp\bunx-1558969007-cross-env@latest\node_modules\cross-env\src\bin\cross-env.js"

Workaround is set my %TEMP% to some relative path like . or ..\ or whatever. For example in cmd:

> set TEMP=.
> bun repl
> rem bun repl started without error

Or in PowerShell:

> $env:TEMP = '.'
> bun repl
> rem bun repl started without error

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

anemochore avatar Aug 05 '24 01:08 anemochore