vercel / next.js

The React Framework
https://nextjs.org
MIT License
125.3k stars 26.77k forks source link

nextjs failed to run the development server (npm run dev) #53766

Open ht-l1 opened 1 year ago

ht-l1 commented 1 year ago

Verify canary release

Provide environment information

$ npx --no-install next info

    Operating System:
      Platform: win32
      Arch: ia32
      Version: Windows 10 Home
    Binaries:
      Node: 18.16.1
      npm: N/A
      Yarn: N/A
      pnpm: N/A
    Relevant Packages:
      next: 13.4.13
      eslint-config-next: N/A
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.1.6
    Next.js Config:
      output: N/A

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

npm run dev

To Reproduce

I installed the nextjs npx create-next-app@latest. Then I run 'npm run dev'.

Describe the Bug

Here's the terminal message: $ npm run dev

> salon@0.1.0 dev > next dev

- ready started server on 0.0.0.0:3000, url: http://localhost:3000 - info Using wasm build of next-swc

And then within a second, the command automatically stopped and closes itself in the terminal (no other errors or messages, just simply auto terminates).

Here are what I have tried to resolve and nothing works - I work in PC:

Expected Behavior

I expect the npm run dev will compile in the terminal -> so when I open 3000 server, I will see something running in the webpage. However it never compiles.

Which browser are you using? (if relevant)

Chrome

How are you deploying your application? (if relevant)

No response

manoadamro commented 1 year ago

I'm seeing the same. The only way I can get it to work is with NODE_OPTIONS='--inspect' npm run dev. However, even that only works for me in chrome and it will break if you open the developer console.

ht-l1 commented 1 year ago

hey @manoadamro I finally resolved it. I went in the system setting "Add or Remove Programs" from my windows search bar, I completely uninstalled node from my computer (instead of from bash terminal). Then I go to node official website, re-downloaded the node. Then restarted computer, then it works. Hope it helps you too!