npm run dev silent failure
Unanswered
Polar bear posted this in #help-forum
Polar bearOP
I have created a Next.js app but when I run npm run dev it opens then closes the port without any error message or warning. I've deleted the node_modules file deleted the whole project, reinstalled it multiple times but nothing's worked. Please help
6 Replies
@Polar bear I have created a Next.js app but when I run npm run dev it opens then closes the port without any error message or warning. I've deleted the node_modules file deleted the whole project, reinstalled it multiple times but nothing's worked. Please help
This actually happened to me yesterday and weirdly enough, switching to pnpm fixes it
Not a solution but if you want a temporary workaround there is that
Polar bearOP
Okay, thanks a lot, I'll try it
Turkish Angora
I've just found this thread as I've had exactly the same issue. I started using Next.js yesterday, installed everything as per the official tutorial. All working fine yesterday, but today it's broken? I've not changed anything from yesterday. Anyone have a clue why this happens?
Turkish Angora
Update: same again today. I get the 'ready started server on 0.0.0.0:3000, url: http://localhost:3000' message but when I open localhost in the browser it doesn't load. I noticed the terminal doesn't update like it did yesterday with the build messages when navigating to the different pages, so it seems that there is some build/compile issue when closing everything down and loading up again. Am I missing something??
Turkish Angora
Final update: I've been using git-bash in Windows 10 and after trying changing everything I could think of I switched to WSL/Ubuntu/ZSH and that has fixed the issue. The build was getting stuck during compile but now takes around 15 seconds and no issues for several days now.