0

I installed node.js, and "npm install -g live-server" After that the input of "live-server" in the command line prompt should open up the website that is situated in the current folder, but every time I try to do that, this shows up:

      Serving "C:\Users\AAYUSHI\bg-gen" at http://127.0.0.1:8080
      events.js:288
      throw er; // Unhandled 'error' event
      ^

      Error: spawn cmd ENOENT
      at Process.ChildProcess._handle.onexit           (internal/child_process.js:267:19)
      at onErrorNT (internal/child_process.js:469:16)
      at processTicksAndRejections (internal/process/task_queues.js:84:21)  Emitted 'error' event on
      ChildProcess instance at:
      at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
      at onErrorNT (internal/child_process.js:469:16)
      at processTicksAndRejections (internal/process/task_queues.js:84:21) {   errno: 'ENOENT',   code:     
     'ENOENT',   syscall: 'spawn cmd',   path: 'cmd',   spawnargs: [ '/c',
     'start', '""', '/b', 'http://127.0.0.1:8080' ] }

No browser opens up my website automatically. What do you think is the problem?

Jupiter
  • 19
  • 5
  • looks like it failing to see your default browser and running `start "" /b 'http://127.0.0.1:8080'` which is causing the ENOENT, set a default or use `--browser=` option as shown in the docs. – Lawrence Cherone Apr 04 '20 at 12:16
  • @Jupiter: "the website that is situated in the current folder" - are you referring to `index.html`? Could you show the HTML code of your website? – Henke Jun 30 '20 at 15:55

2 Answers2

0

I checked system variables one more time and found the cause of the problem: missing C:\Windows\System32\ variable. I added it and that solved my problem

Hope, it help you too.

0

Most likely issue with opening the browser. Use this option instead: live-server dist --port=3000 --no-browser