Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Next js Server briefly start then exits

running next dev - the server starts briefly and then closes.

> next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000

and then it exits. I'm using windows Screenshot of the CLI

I used this command as of today

npx create-next-app@latest

and updating node stable version 18.14.2 + additional features while installing , and installing windows WSL since the docs mention this

System Requirements

Node.js 14.6.0 or newer
MacOS,>>>>>>>> Windows (including WSL) <<<<<<<<, and Linux are supported

i've tried localhost:3000 on the browser while the server was "Up" and kept refreshing with no response

tried to update node

deleted node_modules then did npm i still the same problem.

installed windows WSL

how do i make this work ?

like image 466
Fadlo Avatar asked Oct 31 '25 07:10

Fadlo


2 Answers

Installing the latest version of nextjs resolved my issue:

npm install next@latest react@latest react-dom@latest

like image 153
davidaharlow Avatar answered Nov 02 '25 21:11

davidaharlow


Date: 18 March 2023

☠️I also faced the same problem after creating the app using the latest version of nextjs.

And I couldn't solve it even after spending a lot of time 😒

✅Later I install the old version of nextjs and the server starts successfully and doesn't stop automatically.

like image 32
fazle rabbi Avatar answered Nov 02 '25 22:11

fazle rabbi