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

Segmentation fault when creating projects with npm create hono@latest #35

Closed
prosenjitjoy opened this issue Apr 26, 2024 · 8 comments
Closed

Comments

@prosenjitjoy
Copy link

prosenjitjoy commented Apr 26, 2024

Context

Running a simple command like npm create hono@latest ./my-app -- --template cloudflare-pages gives

create-hono version 0.7.0
✔ Using target directory … ./my-app
Segmentation fault (core dumped)

Expected

Should work as intended to create projects using different templates.

Device

Kernel: Linux 6.8.7
Distro: Fedora 40
Node: 20.12.2
NPM: 10.5.0
Git: 2.44.0

@yusukebe
Copy link
Member

Hi @prosenjitjoy

Is git installed in your machine?

@prosenjitjoy
Copy link
Author

prosenjitjoy commented Apr 26, 2024

Hi @prosenjitjoy

Is git installed in your machine?

はい、@yusukebe

My current workaround

creating project manually by copying templates from https://github.com/honojs/starter

Most likely caused by

The problem seems to be with a package called ora. If i remove every instance of spinner(ora) lines from source and run the binary after build it works as intended without any segmentation fault.

Before

prosenjit@joy:/tmp/create-hono$ chmod +x bin 
prosenjit@joy:/tmp/create-hono$ ./bin 
create-hono version 0.7.0
? Target directory my-app
? Which template do you want to use? vercel
? Directory not empty. Continue? yes
Segmentation fault (core dumped)

After

prosenjit@joy:/tmp/create-hono$ chmod +x bin 
prosenjit@joy:/tmp/create-hono$ ./bin 
create-hono version 0.7.0
? Target directory my-app
? Which template do you want to use? nodejs
? Do you want to install project dependencies? yes
? Which package manager do you want to use? npm
🎉 Copied project files
Get started with: cd my-app

@ryuapp
Copy link
Contributor

ryuapp commented Apr 29, 2024

Probably related to the following: sindresorhus/ora#229

@yusukebe
Copy link
Member

yusukebe commented May 1, 2024

Hi @prosenjitjoy @ryuapp

It seems to be related to that ora issue. The easiest way to resolve this issue is to not use ora, but there is no good spinner library, and I'd like to keep using ora.

@ryuapp Or do you know any other library or idea to solve this?

@ryuapp
Copy link
Contributor

ryuapp commented May 1, 2024

Hi @yusukebe
I found nanospinner(https://github.com/usmanyunusov/nanospinner).
I tried it on local and it looks fine.

I can't confirm whether this solves segmentation fault problems because I can't reproduce it, but I think it will work.

@yusukebe
Copy link
Member

yusukebe commented May 1, 2024

@ryuapp

That's good, only on dependency! If you can, could you create the PR to replace ora with nanospinner?

@yusukebe
Copy link
Member

yusukebe commented May 1, 2024

Hi @prosenjitjoy

I've released v0.7.1 now, which includes the fix that replaces ora with nanospinner by @ryuapp #37

Could you try it and let us know the result?

@prosenjitjoy
Copy link
Author

It is now working. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants