Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Support #43

Closed
philippdormann opened this issue Oct 29, 2021 · 198 comments
Closed

Windows Support #43

philippdormann opened this issue Oct 29, 2021 · 198 comments
Assignees
Labels
tracking An umbrella issue for tracking big features windows An issue that only occurs on Windows

Comments

@philippdormann
Copy link

The README and releases tab implies that Windows is not supported for this project.
Is this due to WebKit (JavaScriptCore) being exclusive to *nix platforms (Linux, macOS)?
Are there any plans to support Windows?

The project works great on linux btw 😀🚀

@Jarred-Sumner
Copy link
Collaborator

Jarred-Sumner commented Oct 29, 2021

JavaScriptCore does run on Windows, but it’s less well supported than Unix

The main issue honestly is how bun does I/O. A lot of bun's code makes assumptions that I/O is fast and that reading/writing a file won’t block for long. This is true on Unix, but on Windows, antivirus and locking behavior is different. This means even if bun did compile successfully on Windows, it probably would freeze a lot. This is already kind of a problem in WSL when you access windows files over the network mounted fs. I’m not sure how to fix this yet, but honestly I haven’t put a lot of thought into it

@kosperera
Copy link

kosperera commented Jul 11, 2022

I tried spinning up a Bun Development Container on a Windows 10 with WSL 2 and did not come across any issues. Of course, I just tried the quick-start code snippet only. Still, no hiccups when setting up and getting started so I am happy for now!

@meadowsys
Copy link

In response to the windows filesystem and bun locking thing, I think at least a half decent workaround would be to use non-blocking fs (once it is implemented)

@xHyroM
Copy link
Collaborator

xHyroM commented Jul 28, 2022

179404957-39efb28a-6b26-4da1-b256-b62f01588f1b

@ldsenow
Copy link

ldsenow commented Jul 29, 2022

179404957-39efb28a-6b26-4da1-b256-b62f01588f1b

Haha. I like how you urge the importance of having a Windows version.

@Unnoen
Copy link

Unnoen commented Aug 1, 2022

For Windows I/O, it may be possible to leverage the MFT for some operations, namely file enumeration. It is significantly faster than the default provided APIs.

Downsides are that administrator privileges are required to read the MFT, and it's only for the NTFS filesystem. So it has some fairly big disadvantages, but I felt it was worth mentioning.

Otherwise, depending on the amount of files, it might be necessary to open file handles on initialisation and keep them open for files that will be used a lot to avoid third-party AVs from constantly rescanning when the handle is opened/closed.

Possibly out of scope, but it is possible to get all registered security products for a Windows install in user space, it could be used for a warning message to the user that performance may be impacted if third-party AVs are detected.

@kpldvnpne
Copy link

Is there any way I can contribute to help speed up windows support?

@mekwall
Copy link

mekwall commented Sep 28, 2022

Just so that its completely clear, WSL is not native Windows. WSL is essentially a Linux emulator inside Windows. Its about the worst case scenario of "this works on Windows" that you can get. Most Windows devs probably wouldn't even consider a project to support Windows, unless it can do so outside the context of WSL.

WSL2 is not a "a Linux emulator inside Windows" but a compatibility layer using a highly optimized subset of Hyper-V that enables running ELF64 Linux binaries natively on Windows. It has magnitudes less overhead compared to emulation or other virtualization technologies such as VirtualBox or VMWare. Sure, there is an overhead of using WSL but most of it is in higher memory usage and not so much in CPU or I/O. Phoronix test suite using WSL on Windows 10 shows you get around 87% overall performance (with WSL2) compared to bare metal and that should have improved with Windows 11.

Not saying we don't need native Windows support without WSL in Bun, but for development WSL2 should be just fine. As long as you don't plan on running Bun in production on a Windows Machine ;)

@FeldrinH
Copy link

For me the main concern with WSL as a substitute for native Windows support isn't performance. It is that WSL adds a layer of complexity to getting any editor tooling working with Bun. Yes, there are ways for editors running natively on Windows to communicate with and run binaries in a WSL environment, but the last time I tried (about a year ago with Crystal), those solutions were quite fiddly and unreliable compared to programming languages with native Windows support.

@salmenf
Copy link

salmenf commented Oct 12, 2022

I can share a bit of different use case: I need the capability to manage npm packages and bundle code not for tooling, but on the user end of a Tauri app (similar to Electron, web apps on desktop). The end user's device could be Windows/Mac/Linux. Right now I use a combination of npm and esbuild for this. Bun would simplify this to a single dependency and improve performance on package management massively. It quite simply doesn't work with WSL since I'd need to ask the user to set up WSL.

This is just to say there are (admittedly, weird) use cases where "WSL" vs. "native" makes a difference, regardless of the technical distinction. So I appreciate this kind of Windows support is being worked on!

I also find the proposed timeframe reasonable. If you need to get it done faster, I assume you can help out, it's open source afterall. ;)

@Electroid Electroid added tracking An umbrella issue for tracking big features and removed enhancement New feature or request labels Nov 1, 2022
@Electroid Electroid changed the title Windows Support? Windows Support Nov 1, 2022
@Electroid
Copy link
Contributor

Hi folks, just want to give assurance that we know the lack of Windows support is painful. Our goal is to have an official build for Windows before the 1.0 release of Bun, though we want to get it done much earlier than that.

We are already starting to experiment with JavaScriptCore on Windows, which is the first big step.

@mollthecoder
Copy link

mollthecoder commented Nov 29, 2022

For Windows I/O, it may be possible to leverage the MFT for some operations, namely file enumeration. It is significantly faster than the default provided APIs.

Downsides are that administrator privileges are required to read the MFT, and it's only for the NTFS filesystem. So it has some fairly big disadvantages, but I felt it was worth mentioning.

Otherwise, depending on the amount of files, it might be necessary to open file handles on initialisation and keep them open for files that will be used a lot to avoid third-party AVs from constantly rescanning when the handle is opened/closed.

Possibly out of scope, but it is possible to get all registered security products for a Windows install in user space, it could be used for a warning message to the user that performance may be impacted if third-party AVs are detected.

Detecting AVs are a great way to set off the AVs alarm

@CEbbinghaus
Copy link

CEbbinghaus commented Jan 21, 2023

So to add my 2 cents. Glad that it's on the roadmap & planned although I maybe don't have the same emphasis on performance. While I agree that a performant windows version of bun is extremely valuable and should probably be included before 1.0, I don't care if it's slower as long as it works. I feel like a use case that is being ignored here is simply the fact that a lot of development happens on windows even if that code runs on linux servers. So for me, it's worth having it running on windows no matter how slow because when it runs on the server in production it will be fast & efficient.

Other than that just +1 for adding windows support

@rishavs
Copy link

rishavs commented Feb 3, 2023

Hi. I understand that this is under work, but is there any work item tracking all the pieces that need to come together for this? That way it will be easier for people to contribute. Also, is there a dev branch to keep track of for this?

I myself don't need networking right now, but the ffi and typescript engine only.

@umararshad4

This comment was marked as spam.

@Jarred-Sumner Jarred-Sumner unpinned this issue Mar 17, 2023
@RinMinase
Copy link

Is this feature perhaps removed from the priority list? 🤔

@Jarred-Sumner
Copy link
Collaborator

We expect to have a bun install-only version for Windows initially, and then a more complete version following that.

@paperdave
Copy link
Collaborator

paperdave commented Feb 6, 2024

that is one file, out of over four hundred. here is a screenshot from a summary a while ago

image

@liudonghua123
Copy link
Contributor

https://twitter.com/bunjavascript/status/1753267105909416079

We are delaying Bun for Windows until February 15 to get the test suite to pass 100%
To help report bugs, run this:
iwr bun.sh/install.ps1 | iex

It seems the windows release is delayed again, maybe the next release will arrive.

https://bun.sh/blog/bun-v1.0.27#bundows-is-soon

We will ship Windows once more of the test suite passes on Windows. 85% of tests pass right now. We are working on getting that to 100% as quickly as possible.

And I also tried the latest canary build, bun repl I commented above does not work either.

@paperdave
Copy link
Collaborator

bun repl is tracked in #8539. that, and alot of other progress is blocked by #8456

sorry this has been taking extra time. the linked pr is fixing alot of windows compatibility as well as stability improvements that will affect all platforms. it will be worth it.

@liudonghua123
Copy link
Contributor

liudonghua123 commented Mar 18, 2024

https://twitter.com/bunjavascript/status/1753267105909416079

We are delaying Bun for Windows until February 15 to get the test suite to pass 100%
To help report bugs, run this:
iwr bun.sh/install.ps1 | iex

It seems the windows release is delayed again, maybe the next release will arrive.

https://bun.sh/blog/bun-v1.0.27#bundows-is-soon

We will ship Windows once more of the test suite passes on Windows. 85% of tests pass right now. We are working on getting that to 100% as quickly as possible.

And I also tried the latest canary build, bun repl I commented above does not work either.

I tried the latest canary build again. It first crashed the first time, then it seems ok later.

bun 1.0.32 windows error info
Liu.D.H  colorful_classroom_app  git(flutter_3_upgrade)   1m 10.422s  00:30 > bun --version
1.0.32

Liu.D.H  colorful_classroom_app  git(flutter_3_upgrade)   825ms  10:16 > bun repl
  ⚙️  @swc/core [1/1]
uh-oh: incorrect alignment
bun will crash now 😭😭😭

----- bun meta -----
Bun v1.0.32-canary.21 (5fec71bd) Windows x64
AddCommand: extracted_packages
Elapsed: 7228ms | User: 4218ms | Sys: 140ms
RSS: 0.22GB | Peak: 0.29GB | Commit: 0.32GB | Faults: 101501
----- bun meta -----

0   00007FF6D5D6A9B8
1   ???
2   ???
3   ???
4   ???
5   ???
6   ???
7   ???
8   ???
9   ???
10  ???
11  ???
12  ???
13  ???
14  ???
15  ???

Search GitHub issues https://bun.sh/issues or join in #windows channel in https://bun.sh/discord

thread 25920 panic: incorrect alignment
???:?:?: 0x7ff6d4f46a00 in ??? (bun.exe)
???:?:?: 0x7ff6d56aa893 in ??? (bun.exe)
???:?:?: 0x7ff6d56aa7d1 in ??? (bun.exe)
???:?:?: 0x7ff6d569f383 in ??? (bun.exe)
???:?:?: 0x7ff6d569ed1f in ??? (bun.exe)
???:?:?: 0x7ff6d48f03fb in ??? (bun.exe)
???:?:?: 0x7ff6d4935237 in ??? (bun.exe)
???:?:?: 0x7ff6d4930285 in ??? (bun.exe)
???:?:?: 0x7ff6d4940582 in ??? (bun.exe)
???:?:?: 0x7ff6d49db85b in ??? (bun.exe)
???:?:?: 0x7ff6d472157f in ??? (bun.exe)
???:?:?: 0x7ff6d7220ae3 in ??? (bun.exe)
???:?:?: 0x7ff83172257c in ??? (KERNEL32.DLL)
???:?:?: 0x7ff832ecaa57 in ??? (ntdll.dll)

Liu.D.H  colorful_classroom_app  git(flutter_3_upgrade)   7.393s  10:17 >
Liu.D.H  colorful_classroom_app  git(flutter_3_upgrade)   6ms  10:18 > bun repl
Welcome to Bun v1.0.32
Type ".help" for more information.
[!] Please note that the REPL implementation is still experimental!
    Don't consider it to be representative of the stability or behavior of Bun overall.
> ^C
Liu.D.H  colorful_classroom_app  git(flutter_3_upgrade)   6ms  10:18 >
bun 1.0.31 windows error info
Liu.D.H  ~   0ms  22:10 > bun repl
  ⚙️  @swc/core [1/1]
uh-oh: incorrect alignment
bun will crash now 😭😭😭

----- bun meta -----
Bun v1.0.31-canary.63 (e2567512) Windows x64
AddCommand: extracted_packages
Elapsed: 11274ms | User: 6656ms | Sys: 31ms
RSS: 103.05MB | Peak: 103.05MB | Commit: 0.18GB | Faults: 38541
----- bun meta -----

0   00007FF77EC07A88
1   ???
2   ???
3   ???
4   ???
5   ???
6   ???
7   ???
8   ???
9   ???
10  ???
11  ???
12  ???
13  ???
14  ???
15  ???

Search GitHub issues https://bun.sh/issues or join in #windows channel in https://bun.sh/discord

thread 2700 panic: incorrect alignment
???:?:?: 0x7ff77dde1bc0 in ??? (bun.exe)
???:?:?: 0x7ff77e547963 in ??? (bun.exe)
???:?:?: 0x7ff77e5478a1 in ??? (bun.exe)
???:?:?: 0x7ff77e53c453 in ??? (bun.exe)
???:?:?: 0x7ff77e53bdef in ??? (bun.exe)
???:?:?: 0x7ff77d7886ab in ??? (bun.exe)
???:?:?: 0x7ff77d7d4537 in ??? (bun.exe)
???:?:?: 0x7ff77d7cf605 in ??? (bun.exe)
???:?:?: 0x7ff77d7df8f2 in ??? (bun.exe)
???:?:?: 0x7ff77d879e7b in ??? (bun.exe)
???:?:?: 0x7ff77d5c157f in ??? (bun.exe)
???:?:?: 0x7ff7800bea23 in ??? (bun.exe)
???:?:?: 0x7ff885a2257c in ??? (KERNEL32.DLL)
???:?:?: 0x7ff8878aaa57 in ??? (ntdll.dll)

Liu.D.H  ~   12.47s  22:14 > bun repl
readline {
  Interface: [Function],
  clearLine: [Function],
  clearScreenDown: [Function],
  createInterface: [Function],
  cursorTo: [Function],
  emitKeypressEvents: [Function],
  moveCursor: [Function],
  promises: {
    Readline: [class Readline],
    Interface: [class Interface3],
    createInterface: [Function: createInterface],
  },
  [Symbol(__BUN_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED__)]: {
    CSI: [Function],
    utils: {
      getStringWidth: [Function: getStringWidth2],
      stripVTControlCharacters: [Function],
    },
  },
}
Welcome to Bun v1.0.31
Type ".help" for more information.
[!] Please note that the REPL implementation is still experimental!
    Don't consider it to be representative of the stability or behavior of Bun overall.
>

@liudonghua123
Copy link
Contributor

liudonghua123 commented Mar 18, 2024

And it seems the format string is not supported now.

image

Edit: I changed %j to %s, then it works. Bun doesn't support %j currently.

image

@willnode
Copy link

https://isbunwindowsyet.com/

@ducktype
Copy link

ducktype commented Mar 22, 2024

latest canary win11:

without node.exe binary in path:

./bun.exe x @ulixee/cloud start
  ⚙️  better-sqlite3 [1/1] error: bun is not installed

Please run the following command, or double check %PATH%

    powershell -c "irm bun.sh/install.ps1|iex"

"node" non � riconosciuto come comando interno o esterno,
 un programma eseguibile o un file batch.

error: install script from "better-sqlite3" exited with 1

with node.exe binary in path:

bun.exe x @ulixee/cloud start
node:internal/modules/cjs/loader:1147
  throw err;
  ^

Error: Cannot find module 'C:\Users\xxx\AppData\Local\Temp\bunx-3147616870-@ulixee\cloud@latest\node_modules\@ulixee\cloud\bin\cli.js start'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v20.11.1

bunfig load not working?

also seems that bunfig.toml is not loaded/respected from bunfig.toml in the cwd or alongside bun.exe, even if explicitly set with:
bun.exe --config=bunfig.toml x @ulixee/cloud start

for example with the following conf the global cache is still used:
bunfig.toml content:

[install.cache]
dir = "./same_folder_local_cache"

@paperdave
Copy link
Collaborator

without node.exe binary in path:

oh this is interesting, with the ./bun.exe implied it seems that bun is not in your path either. bun should fix this and ensure that it itself is within path. i opened #9572

with node.exe binary in path:

bug i will fix soon:tm:

bunfig load not working?

im not sure ...

@ducktype
Copy link

ducktype commented Mar 23, 2024

win11 using latest canary from 5 hours ago:

PS C:\Users\xxxuser\Desktop\bun_test> ./bun.exe --bun x @ulixee/cloud start
Starting Ulixee Cloud with configuration: {
  maxConcurrentHeroes: 10,
  maxConcurrentHeroesPerBrowser: 10,
  datastoreWaitForCompletion: false,
  heroDataDir: "C:\\Users\\xxxuser\\AppData\\Local\\Temp/.ulixee",
  datastoreStorageDir: "C:\\Users\\xxxuser\\AppData\\Local/ulixee/datastores",
}
107 |         return opts[p] || p;
108 |       })
109 |     );
110 |     tries.push(n);
111 |     try {
112 |       b = opts.path ? requireFunc.resolve(n) : requireFunc(n);
                                                     ^
TypeError: LoadLibrary failed: Routine di inizializzazione della libreria di
      at bindings (C:\Users\xxxuser\AppData\Local\Temp\bunx-3147616870-@ulixee\cloud@latest\node_modules\bindings\bindings.js:112:48)
      at new Database (C:\Users\xxxuser\AppData\Local\Temp\bunx-3147616870-@ulixee\cloud@latest\node_modules\better-sqlite3\lib\database.js:48:29)
      at new NetworkDb (C:\Users\xxxuser\AppData\Local\Temp\bunx-3147616870-@ulixee\cloud@latest\node_modules\@ulixee\hero-core\dbs\NetworkDb.js:18:19)
      at new HeroCore (C:\Users\xxxuser\AppData\Local\Temp\bunx-3147616870-@ulixee\cloud@latest\node_modules\@ulixee\hero-core\index.js:60:26)
      at new CloudNode (C:\Users\xxxuser\AppData\Local\Temp\bunx-3147616870-@ulixee\cloud@latest\node_modules\@ulixee\cloud\lib\CloudNode.js:76:25)
      at C:\Users\xxxuser\AppData\Local\Temp\bunx-3147616870-@ulixee\cloud@latest\node_modules\@ulixee\cloud\cli\index.js:73:27
      at C:\Users\xxxuser\AppData\Local\Temp\bunx-3147616870-@ulixee\cloud@latest\node_modules\@ulixee\cloud\cli\index.js:64:24
      at _parseCommand (C:\Users\xxxuser\AppData\Local\Temp\bunx-3147616870-@ulixee\cloud@latest\node_modules\commander\lib\command.js:1283:22)
      at _dispatchSubcommand (C:\Users\xxxuser\AppData\Local\Temp\bunx-3147616870-@ulixee\cloud@latest\node_modules\commander\lib\command.js:1077:18)
      at C:\Users\xxxuser\AppData\Local\Temp\bunx-3147616870-@ulixee\cloud@latest\node_modules\commander\lib\command.js:935:11
      at parseAsync (C:\Users\xxxuser\AppData\Local\Temp\bunx-3147616870-@ulixee\cloud@latest\node_modules\commander\lib\command.js:933:20)
      at C:\Users\xxxuser\AppData\Local\Temp\bunx-3147616870-@ulixee\cloud@latest\node_modules\@ulixee\cloud\bin\cli.js:6:5

Segmentation fault at address 0x7ffdd90a0d90
???:?:?: 0x7ffe2ac2129b in ??? (ntdll.dll)
???:?:?: 0x7ffe2ac20ff6 in ??? (ntdll.dll)
???:?:?: 0x7ffe2ac20c9c in ??? (ntdll.dll)
???:?:?: 0x7ffe29f37faa in ??? (KERNEL32.DLL)
???:?:?: 0x7ffe27f2bb17 in ??? (ucrtbase.dll)
???:?:?: 0x7ffe27f2bcd8 in ??? (ucrtbase.dll)
???:?:?: 0x7ff737c896f2 in ??? (bun.exe)
???:?:?: 0x7ff737a1119b in ??? (bun.exe)
???:?:?: 0x7ff737d10115 in ??? (bun.exe)
???:?:?: 0x7ff73a1399ba in ??? (bun.exe)
???:?:?: 0x7ff737c895ac in ??? (bun.exe)
???:?:?: 0x7ff737ddd912 in ??? (bun.exe)
???:?:?: 0x7ff737c8e238 in ??? (bun.exe)
???:?:?: 0x7ff737c162c3 in ??? (bun.exe)
???:?:?: 0x7ff737c1463b in ??? (bun.exe)
???:?:?: 0x7ff737c9e158 in ??? (bun.exe)
???:?:?: 0x7ff7379e16ef in ??? (bun.exe)
???:?:?: 0x7ff73a4e00e3 in ??? (bun.exe)
???:?:?: 0x7ffe29f3257c in ??? (KERNEL32.DLL)
???:?:?: 0x7ffe2ac2aa57 in ??? (ntdll.dll)

the native binding for better-sqlite3 dll its present at C:\Users\xxxuser\AppData\Local\Temp\bunx-3147616870-@ulixee\cloud@latest\node_modules\better-sqlite3\build\Release\better_sqlite3.node and is linked against node.exe, probably the one that segfaults while loading:

i'm missing something or should be possible to use prebuilt native bindings for node in bun?
seems confusion never settle about this topic:
denoland/deno#18444
WiseLibs/better-sqlite3#1034 (comment)
barthofu/tscord#158
neon-bindings/neon#584
https://www.electronjs.org/docs/latest/tutorial/using-native-node-modules

seems totally unclear if native node-gyp prebuilt node bindings can be shared across multiple js runtimes bun deno electron etc...
in some way as explained and considered possible in this article with node-gyp win_delay_load_hook:
https://www.electronjs.org/docs/latest/tutorial/using-native-node-modules

seems no one can make it work without the library itself being designed without node-gyp and using runtime lazyload of node-apis as proposed here neon-bindings/neon#584
but anyway no one is going to rewrite access to node-api lazily, binding authors use node-gyp and we must unfortunalaty handle it

also the following folder is missing in cache:
C:\Users\xxxuser\AppData\Local\Temp\bunx-3147616870-@ulixee\cloud@latest\node_modules@ulixee\unblocked-agent-mitm-socket/dist

files in this folder are downloaded by a postinstallscript, so seems a symptom of not running postinstall scripts...should not bunx imply installing packages with pm trust --all? at least with bunx we are running code from the internet explicity anyway... i don't see a cli option to enable trust for bun x subcommand

@xHyroM
Copy link
Collaborator

xHyroM commented Apr 1, 2024

I think, we can finally close this @paperdave

@codeblitz97
Copy link

Released finally

@paperdave
Copy link
Collaborator

https://bun.sh/blog/bun-v1.1

@Sandros94
Copy link

We sure this isn't an april's fool? 🤣

@sitiom
Copy link
Contributor

sitiom commented Apr 1, 2024

Scoop and Winget packages coming up:

@LucasBonafe
Copy link

We sure this isn't an april's fool? 🤣

I'm also waiting confirmation...

@metaspartan
Copy link

We sure this isn't an april's fool? 🤣

I'm also waiting confirmation...

Well it exists XD, but bun install non-working on Windows, runs into:

bun install v1.1.0 (5903a614)

uh-oh: reached unreachable code
bun will crash now 😭😭😭

----- bun meta -----
Bun v1.1.0 (5903a614) Windows x64
InstallCommand: dotenv
Elapsed: 11ms | User: 0ms | Sys: 0ms
RSS: 46.01MB | Peak: 46.01MB | Commit: 92.32MB | Faults: 11394
----- bun meta -----

0   00007FF676FDA4C8
1   ???
2   ???
3   ???
4   ???
5   ???
6   ???
7   ???
8   ???
9   ???
10  ???
11  ???
12  ???
13  ???
14  ???
15  ???

Search GitHub issues https://bun.sh/issues or join in #windows channel in https://bun.sh/discord

thread 561060 panic: reached unreachable code
???:?:?: 0x7ff675c82767 in ??? (bun.exe)
???:?:?: 0x7ff675c03894 in ??? (bun.exe)
???:?:?: 0x7ff675b14607 in ??? (bun.exe)
???:?:?: 0x7ff675b0e357 in ??? (bun.exe)
???:?:?: 0x7ff675b0c86e in ??? (bun.exe)
???:?:?: 0x7ff675b1a606 in ??? (bun.exe)
???:?:?: 0x7ff675b4cdda in ??? (bun.exe)
???:?:?: 0x7ff675b84ce0 in ??? (bun.exe)
???:?:?: 0x7ff675b82610 in ??? (bun.exe)
???:?:?: 0x7ff675c354c2 in ??? (bun.exe)
???:?:?: 0x7ff675961603 in ??? (bun.exe)
???:?:?: 0x7ff678497e33 in ??? (bun.exe)
???:?:?: 0x7ffed9fb257c in ??? (KERNEL32.DLL)
???:?:?: 0x7ffedb72aa57 in ??? (ntdll.dll)

@CEbbinghaus
Copy link

CEbbinghaus commented Apr 2, 2024

I too am having an error with bun install. But I would like to caution anyone against adding any more comments to this thread. As of @paperdave's last comment this thread should be considered completed and any errors should be raised in their own Issues to be addressed independent of this thread.

@metaspartan see #9808

If people keep posting bug reports here it might be better to just lock this thread.

@liudonghua123
Copy link
Contributor

I tried to install via npm install -g bun, but it did not work for me.

Liu.D.H  ~   13ms  21:35 > npm install -g bun

added 3 packages in 35s
npm notice
npm notice New minor version of npm available! 10.2.4 -> 10.5.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.5.0
npm notice Run npm install -g [email protected] to update!
npm notice

Liu.D.H  ~   8.035s  21:36 > bun
C:\Users\Liu.D.H\AppData\Roaming\npm\node_modules\bun\bin\bun:1
MZx


SyntaxError: Invalid or unexpected token
    at internalCompileFunction (node:internal/vm:77:18)
    at wrapSafe (node:internal/modules/cjs/loader:1288:20)
    at Module._compile (node:internal/modules/cjs/loader:1340:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49

Node.js v20.11.0

Liu.D.H  ~   1.191s  21:36 >
Liu.D.H  ~   19ms  21:36 > where bun
C:\Users\Liu.D.H\AppData\Roaming\npm\bun
C:\Users\Liu.D.H\AppData\Roaming\npm\bun.cmd

Liu.D.H  ~   179ms  21:36 > cat C:\Users\Liu.D.H\AppData\Roaming\npm\bun.cmd
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0

IF EXIST "%dp0%\node.exe" (
  SET "_prog=%dp0%\node.exe"
) ELSE (
  SET "_prog=node"
  SET PATHEXT=%PATHEXT:;.JS;=;%
)

endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\node_modules\bun\bin\bun" %*

Liu.D.H  ~   36ms  21:36 > dir C:\Users\Liu.D.H\AppData\Roaming\npm\node_modules\bun\bin
 Volume in drive C is System
 Volume Serial Number is 5664-FB65

 Directory of C:\Users\Liu.D.H\AppData\Roaming\npm\node_modules\bun\bin

2024/04/02  21:36    <DIR>          .
2024/04/02  21:36    <DIR>          ..
2024/04/02  21:36        97,571,328 bun.exe
               1 File(s)     97,571,328 bytes
               2 Dir(s)  34,412,261,376 bytes free

Liu.D.H  ~   114ms  21:36 > mv C:\Users\Liu.D.H\AppData\Roaming\npm\node_modules\bun\bin\bun C:\Users\Liu.D.H\AppData\
Roaming\npm\node_modules\bun\bin\bun.exe

Liu.D.H  ~   107ms  21:36 > bun --version
node:internal/modules/cjs/loader:1147
  throw err;
  ^

Error: Cannot find module 'C:\Users\Liu.D.H\AppData\Roaming\npm\node_modules\bun\bin\bun'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v20.11.0

Liu.D.H  ~   90ms  21:36 >
Liu.D.H  ~   0ms  21:36 > C:\Users\Liu.D.H\AppData\Roaming\npm\node_modules\bun\bin\bun.exe --version
1.1.0

Liu.D.H  ~   36ms  21:36 >

I have to rename the binary append .exe and update the bun.cmd remove "%_prog%".

Liu.D.H  ~   39ms  21:49 > sublime C:\Users\Liu.D.H\AppData\Roaming\npm\bun.cmd

Liu.D.H  ~   9ms  21:49 > cat C:\Users\Liu.D.H\AppData\Roaming\npm\bun.cmd
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0

IF EXIST "%dp0%\node.exe" (
  SET "_prog=%dp0%\node.exe"
) ELSE (
  SET "_prog=node"
  SET PATHEXT=%PATHEXT:;.JS;=;%
)

endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%dp0%\node_modules\bun\bin\bun.exe" %*

Liu.D.H  ~   116ms  21:49 > bun --version
1.1.0

Liu.D.H  ~   40ms  21:49 >

@tjementum
Copy link

Congratulations on the Windows release. 🍾

Please make Bun available on Chocolatey (it's a package manager like Homebrew).

It's essential to make it easy to instruct people how to install prerequisites for a project. I understand that you have just one PowerShell command on Windows, but if you need to install many things, this becomes complex. You want to be able to have simple instructions like:

choco install git docker-desktop nodejs bun

This is equivalent to:

brew install git docker node bun

@aishuaikang
Copy link

C:\Users\18333\Downloads>powershell -c "irm bun.sh/install.ps1 | iex"
Install Failed:
Bun for Windows is currently only available for x86 64-bit Windows.

1

@aishuaikang
Copy link

C:\Users\18333\Downloads>powershell -c "irm bun.sh/install.ps1 | iex"C:\Users\18333\Downloads>powershell -c “irm bun.sh/install.ps1 |iex” Install Failed: 安装失败: Bun for Windows is currently only available for x86 64-bit Windows.Bun for Windows 目前仅适用于 x86 64 位 Windows。

1

My computer is PROCESS SOR ARCHITECTURE=AMD64

@Jarred-Sumner
Copy link
Collaborator

Jarred-Sumner commented Apr 4, 2024

Windows support shipped in Bun v1.1.

If you run into bugs or have feature requests please search for existing issues or file a new issue

@oven-sh oven-sh locked as resolved and limited conversation to collaborators Apr 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tracking An umbrella issue for tracking big features windows An issue that only occurs on Windows
Projects
None yet
Development

No branches or pull requests