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

bun create hono on Windows needs Node.js #12038

Closed
ryuapp opened this issue Jun 21, 2024 · 3 comments
Closed

bun create hono on Windows needs Node.js #12038

ryuapp opened this issue Jun 21, 2024 · 3 comments
Labels
bug Something isn't working needs triage

Comments

@ryuapp
Copy link

ryuapp commented Jun 21, 2024

What version of Bun is running?

1.1.13

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What steps can reproduce the bug?

Related: honojs/create-hono#51

Please uninstall Node.js first.
And run the following command:

bun create hono

And select "x-basic" as a template.
Once the template is cloned, I got an error on readFileSync.

What is the expected behavior?

No response

What do you see instead?

C:\Users\xxxx\>bun create hono
create-hono version 0.9.0
? Target directory my-app
? Which template do you want to use? x-basic
? Directory not empty. Continue? yes
✔ Cloning the template
22377 |       projectDependenciesHook.applyHook(templateName, {
22378 |         directoryPath: targetDirectoryPath
22379 |       })
22380 |     );
22381 |   } catch (e) {
22382 |     throw new Error(
                  ^
error: Error running hook for x-basic: No such file or directory
      at C:\Users\xxxx\AppData\Local\Temp\bunx-2632733703-create-hono@latest\node_modules\create-hono\bin:22382:11

Bun v1.1.13 (Windows x64)

Additional information

This only occurs without Node.js installed on Windows.
If I download create-hono bin file locally and run it, I will get an error even though Node.js is installed.

Looks like there is a problem with readFileSync/writeFileSync.
https://github.com/honojs/create-hono/blob/f7ba1917bd1087c71deeea7e2a408484f08a8ba9/src/hooks/after-create.ts#L11-L16

@ryuapp ryuapp added bug Something isn't working needs triage labels Jun 21, 2024
@dylan-conway
Copy link
Member

Most likely this was fixed with #11990. Can you try this with canary? (bun upgrade --canary)

@ryuapp
Copy link
Author

ryuapp commented Jun 22, 2024

Unfortunately it fails the same way.

C:\Users\xxxx>bun create [email protected]
create-hono version 0.9.0
? Target directory my-app
? Which template do you want to use? x-basic
? Directory not empty. Continue? yes
✔ Cloning the template
22377 |       projectDependenciesHook.applyHook(templateName, {
22378 |         directoryPath: targetDirectoryPath
22379 |       })
22380 |     );
22381 |   } catch (e) {
22382 |     throw new Error(
                  ^
error: Error running hook for x-basic: No such file or directory
      at C:\Users\xxxx\AppData\Local\Temp\b[email protected]\node_modules\create-hono\bin:22382:11

Bun v1.1.16-canary.1+3b199cde5 (Windows x64)

@ryuapp
Copy link
Author

ryuapp commented Jun 25, 2024

There was a problem with a library it was using.
Tracking this in #12150.

@ryuapp ryuapp closed this as not planned Won't fix, can't repro, duplicate, stale Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants