How to resolve segmentation fault?
Unanswered
Berylline Hummingbird posted this in #help-forum
Berylline HummingbirdOP
I created a new project from
It doesn't seem to be an issue with Node.js installation.
Would you please help me resolve this?
create-next-app and it fails running after npm run dev and tries to access localhost:3000 saying: /c/Program Files/nodejs/npm: line 65: 193 Segmentation fault "$NODE_EXE" "$NPM_CLI_JS" "$@"It doesn't seem to be an issue with Node.js installation.
Would you please help me resolve this?
42 Replies
@Berylline Hummingbird I created a new project from `create-next-app` and it fails running after `npm run dev` and tries to access `localhost:3000` saying:
/c/Program Files/nodejs/npm: line 65: 193 Segmentation fault "$NODE_EXE" "$NPM_CLI_JS" "$@"
It doesn't seem to be an issue with Node.js installation.
Would you please help me resolve this?
Greek Shepherd
What shell did u run this in? Vscode's terminal?
@Greek Shepherd What shell did u run this in? Vscode's terminal?
Berylline HummingbirdOP
yes, and even tried with git bash as well.
@Berylline Hummingbird yes, and even tried with git bash as well.
Greek Shepherd
Could u try in vscodes terminal again or in a command prompt window? Not in git bash
And send the output
Berylline HummingbirdOP
fails silently with no error
Greek Shepherd
Whats ur nodejs version? Also did you run npm install ahead of time?
Berylline HummingbirdOP
tried with different nodejs versions. 20, 22, 24
created this proj with npx so npm install was not needed
Greek Shepherd
ah right
@Berylline Hummingbird tried with different nodejs versions. 20, 22, 24
Greek Shepherd
weird tho. im on 24 rn with no issues. what if u try to run npm build and then
node .next/standalone/server.js (i think thats the right path)wait no thats for standalone
hang on
Greek Shepherd
hm nevermind that only exists for standalone builds sorry. did u change any default configuration options for create-next-app? if not im not sure i can help any further
@Greek Shepherd hm nevermind that only exists for standalone builds sorry. did u change any default configuration options for create-next-app? if not im not sure i can help any further
Berylline HummingbirdOP
no, i didn't change anything
it works with next.js earlier version btw
I tried with v14.2.33 and it works
Greek Shepherd
mby just try to delete n run npx again but make sure ur in a command prompt not git terminal
@Berylline Hummingbird I tried with v14.2.33 and it works
Greek Shepherd
u tried a separate npx create-next-app? or just changed the version using npm?
Berylline HummingbirdOP
yes i tried seperate npx create next app
@Greek Shepherd mby just try to delete n run npx again but make sure ur in a command prompt not git terminal
Berylline HummingbirdOP
ah it fails again 😭
https://github.com/vercel/next.js/discussions/43436
I found this but its not answered yet. segmentation fault is difficult to debug
I found this but its not answered yet. segmentation fault is difficult to debug
try adding
--webpack in args, it could be smth in turbopack@riský try adding `--webpack` in args, it *could* be smth in turbopack
Berylline HummingbirdOP
You mean by
npm run dev --webpack ?yeah
Berylline HummingbirdOP
yeah tried with that but not working too
damn, so your cmd/git bash and another person ages ago on macos had it too
very weird
Berylline HummingbirdOP
I'm using windows btw
CRA works pretty fine,
out of curiosity, i kinda want to see if https://bun.com runtime gives a better stack trace for crash lol (but its fine if thats too much changes for you)
# install bun on windows
powershell -c "irm bun.sh/install.ps1 | iex"
# init a new one just in case, but it should still work decently with npm's install
bunx --bun create-next-app
# run next dev in bun runtime
bun --bun run devoh also you arent on windows arm are you?
Berylline HummingbirdOP
windows arm?
its Intel
@Berylline Hummingbird windows arm?
you prob would know if you were using it, but some low-end new laptops run on windows arm and it has really native apps bad support, so nearly everything is emulated (which creates cases for easy crashes)
Berylline HummingbirdOP
yes im using it and its not arm, it's intel based
cool cool
and its not like a really old one is it
-# (if it were, bun would refuse to install i believe anyway lol)
-# (if it were, bun would refuse to install i believe anyway lol)
@riský and its not like a really old one is it
-# (if it were, bun would refuse to install i believe anyway lol)
Berylline HummingbirdOP
its considerably good one 😁
yooo
@riský out of curiosity, i kinda want to see if <https://bun.com> runtime gives a better stack trace for crash lol (but its fine if thats too much changes for you)
sh
# install bun on windows
powershell -c "irm bun.sh/install.ps1 | iex"
# init a new one just in case, but it should still work decently with npm's install
bunx --bun create-next-app
# run next dev in bun runtime
bun --bun run dev
Berylline HummingbirdOP
OMG, what did I do wrong? Im innocent, even bun fails on my end
@Berylline Hummingbird OMG, what did I do wrong? Im innocent, even bun fails on my end
whats the terminal output if you dont mind
(hopefully it has a bun.report link too)