# VS Code Live sever not working

**URL:** <https://forum.freecodecamp.org/t/vs-code-live-sever-not-working/460192>\
**Category:** General\
**Created:** [May 13, 2021, 8:02pm UTC](https://forum.freecodecamp.org/t/vs-code-live-sever-not-working/460192 "2021-05-13T20:02:40Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![paolo6996](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@paolo6996](https://forum.freecodecamp.org/u/paolo6996)\
**Post date:** [May 13, 2021, 8:02pm UTC](https://forum.freecodecamp.org/t/vs-code-live-sever-not-working/460192/1 "2021-05-13T20:02:40Z")

</div>

Hi, I’m trying to open just a basic html file with the live-server extension in vs code on a Chromebook but it keeps giving me these errors.

console.ts:137 [Extension Host] rejected promise not handled within 1 second: Error: spawn google-chrome ENOENT

console.ts:137 [Extension Host] stack trace: Error: spawn google-chrome ENOENT  
at Process.ChildProcess.\_handle.onexit (internal/child\_process.js:269:19)  
at onErrorNT (internal/child\_process.js:465:16)  
at processTicksAndRejections (internal/process/task\_queues.js:80:21)

ERR spawn google-chrome ENOENT: Error: spawn google-chrome ENOENT  
at Process.ChildProcess.\_handle.onexit (internal/child\_process.js:269:19)  
at onErrorNT (internal/child\_process.js:465:16)  
at processTicksAndRejections (internal/process/task\_queues.js:80:21)

When I click the Go Live button as well after I click it it will say port with a circle backslash sign. It does work if I go to the live page my self when I type in this [http://127.0.0.1:44161/index.html](http://127.0.0.1:44161/index.html) but I’m wondering why it doesn’t work when I click go live, right click/shortcut command open with live server, or when I type live-server in the command line/terminal.

---

<div class="post-metadata">

**Author:** ![lasjorg](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/lasjorg/32/280761_2.png) [@lasjorg](https://forum.freecodecamp.org/u/lasjorg)\
**Post date:** [May 13, 2021, 11:36pm UTC](https://forum.freecodecamp.org/t/vs-code-live-sever-not-working/460192/2 "2021-05-13T23:36:35Z")

</div>

Seems like it is failing to spawn the process to open the browser automatically.

VS Code \> Settings \> search for “Live Server” \> Live Server\>Settings: Custom Browser. If null, try changing it to chrome or firefox (if you have it) and see if that changes anything.

You can also try setting the path manually under “Advance Custom Browser Cmd Line” in the settings.json

`chrome://version/` in the address bar should give you the browser path.

---

<div class="post-metadata">

**Author:** ![paolo6996](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@paolo6996](https://forum.freecodecamp.org/u/paolo6996)\
**Post date:** [May 14, 2021, 2:25am UTC](https://forum.freecodecamp.org/t/vs-code-live-sever-not-working/460192/3 "2021-05-14T02:25:42Z")

</div>

![Screenshot 2021-05-13 10.17.50 PM](https://global.discourse-cdn.com/freecodecamp/original/3X/8/5/85328ffd1af2d996e58915e46e8cc8dcff9d4eb4.png)

Here are my settings.json that I have. I had the custom browser set to chrome and it still didn’t work. For “Advance Custom Browser Cmd Line” what value another than null can I put in for chrome or Firefox to be set as my default browser? did you mean to put chrome://version/ as a value in that setting or did you mean that’s what should be in the browser address bar when I open a file in the live server?  
My Chromebook runs a Debian Linux beta, I don’t know though if that has anything to do with why the live server is not running.

---

<div class="post-metadata">

**Author:** ![lasjorg](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/lasjorg/32/280761_2.png) [@lasjorg](https://forum.freecodecamp.org/u/lasjorg)\
**Post date:** [May 14, 2021, 2:55pm UTC](https://forum.freecodecamp.org/t/vs-code-live-sever-not-working/460192/4 "2021-05-14T14:55:51Z")

</div>

Put `chrome://version/` in the browser address bar and press enter. It will give you information about the path to Chrome so you can put the full path in the settings file.

It might be related to the platform (Chromebook/Linux) there might be some [restrictions](https://chromeos.dev/en/linux/setup#security-and-permissions). Also, is it Chrome, or Chromium that is used as the browser?

---

<div class="post-metadata">

**Author:** ![paolo6996](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@paolo6996](https://forum.freecodecamp.org/u/paolo6996)\
**Post date:** [May 24, 2021, 6:01pm UTC](https://forum.freecodecamp.org/t/vs-code-live-sever-not-working/460192/5 "2021-05-24T18:01:16Z")

</div>

It is chrome that is used as the default browser. Do I type the executable path or the profile path in the settings? I do think it has something to do with restrictions to Linux/Chromebook. Other extensions haven’t worked for me either on this computer and one of the shortcuts (the alt/option up button) has not worked for me.

 ![Screenshot 2021-05-24 1.56.09 PM](https://global.discourse-cdn.com/freecodecamp/original/3X/3/7/3700ff695f28f128776ba62a247fd81ff15a3466.png)

---

<div class="post-metadata">

**Author:** ![lasjorg](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/lasjorg/32/280761_2.png) [@lasjorg](https://forum.freecodecamp.org/u/lasjorg)\
**Post date:** [May 24, 2021, 9:27pm UTC](https://forum.freecodecamp.org/t/vs-code-live-sever-not-working/460192/6 "2021-05-24T21:27:11Z")

</div>

There is a fork of the Live Server extension which is actively maintained. Looking at the commit history I can see some updates to the code related to opening the browser, so it might be worth a try.

> **[Live Server (Five Server) - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server)**
>
> Extension for Visual Studio Code - A better Live Server with instant updates, highlights and some PHP support.

* * *

One of the updates is specific to the npm package used for opening the browser ([open](https://www.npmjs.com/package/open)) (Live Server is using 5.0.3, the fork is using 8.0.8). And looking at the package docs and your error message they might be related (the rejected promise).

> open(target, options?)
> 
> Returns a promise for the spawned child process. You would normally not need to use this for anything, but it can be useful if you’d like to attach custom event listeners or perform other operations directly on the spawned process.

---

<div class="post-metadata">

**Author:** ![paolo6996](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@paolo6996](https://forum.freecodecamp.org/u/paolo6996)\
**Post date:** [May 30, 2021, 4:15am UTC](https://forum.freecodecamp.org/t/vs-code-live-sever-not-working/460192/7 "2021-05-30T04:15:25Z")

</div>

The five server extension works for me. The server opens on Firefox but not on chrome. I tried to edit the browser settings in Five Server using the JSON file but it does not seem to respond.

 ![Screenshot 2021-05-30 12.12.43 AM](https://global.discourse-cdn.com/freecodecamp/original/3X/e/d/ed590e2d9d38d8d454b42cbaf84a8ccffb0e1bd7.png)

---

<div class="post-metadata">

**Author:** ![lasjorg](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/lasjorg/32/280761_2.png) [@lasjorg](https://forum.freecodecamp.org/u/lasjorg)\
**Post date:** [May 30, 2021, 3:37pm UTC](https://forum.freecodecamp.org/t/vs-code-live-sever-not-working/460192/8 "2021-05-30T15:37:41Z")

</div>

Good to hear it works.

Not sure what the correct string is for the option. But looking at the open npm package it might be `google-chrome` (on Linux).

---

<div class="post-metadata">

**Author:** ![paolo6996](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@paolo6996](https://forum.freecodecamp.org/u/paolo6996)\
**Post date:** [May 31, 2021, 4:38am UTC](https://forum.freecodecamp.org/t/vs-code-live-sever-not-working/460192/9 "2021-05-31T04:38:35Z")

</div>

Still doesn’t work. Do you think because this is still a new extension that it might be a bug? Thanks for your prompt responses and help with this by the way.

 ![Screenshot 2021-05-31 12.35.50 AM](https://global.discourse-cdn.com/freecodecamp/original/3X/9/4/940ad10b13717bdd2e3c744445bd7a2a8ad9ffd5.png)

---

<div class="post-metadata">

**Author:** ![lasjorg](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/lasjorg/32/280761_2.png) [@lasjorg](https://forum.freecodecamp.org/u/lasjorg)\
**Post date:** [May 31, 2021, 4:38pm UTC](https://forum.freecodecamp.org/t/vs-code-live-sever-not-working/460192/10 "2021-05-31T16:38:48Z")

</div>

I don’t believe the use of VS Code settings has been implemented yet. Look at the [docs](https://github.com/yandeu/five-server#documentation) they show using an `.fiveserverrc` or `fiveserver.config.js`

.fiveserverrc

```auto
{
  "browser": "chrome"
}

```

fiveserver.config.js

```auto
module.exports = {
  browser: "chrome",
}

```

* * *

Still not sure if the string depends on the OS or not.

You can add this to the `fiveserver.config.js` file. It will try them all and log out the attempts to the terminal (VS Code \> View \> Terminal).

```auto
module.exports = {
  debugVSCode: true,
  browser: ["google chrome", "google-chrome", "google-chrome-stable", "chrome"],
};

```

Should output something like this:

```auto
Could not open browser "google chrome". Trying "google-chrome" next.
Could not open browser "google-chrome". Trying "google-chrome-stable" next.
Could not open browser "google-chrome-stable". Trying "chrome" next.

```

* * *

If it still doesn’t work, I would suggest opening [an issue](https://github.com/yandeu/five-server/issues) on the extension repo.

---

<div class="post-metadata">

**Author:** ![paolo6996](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@paolo6996](https://forum.freecodecamp.org/u/paolo6996)\
**Post date:** [June 13, 2021, 4:55am UTC](https://forum.freecodecamp.org/t/vs-code-live-sever-not-working/460192/11 "2021-06-13T04:55:19Z")

</div>

Do I make the fiveserver.config.js file like this or am I doing something wrong here?

 ![Screenshot 2021-06-13 12.41.03 AM](https://global.discourse-cdn.com/freecodecamp/original/3X/4/4/44cc062da88fc937f09610da41f52b1800e327db.png)

---

<div class="post-metadata">

**Author:** ![lasjorg](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/lasjorg/32/280761_2.png) [@lasjorg](https://forum.freecodecamp.org/u/lasjorg)\
**Post date:** [June 13, 2021, 5:15pm UTC](https://forum.freecodecamp.org/t/vs-code-live-sever-not-working/460192/12 "2021-06-13T17:15:49Z")

</div>

Only one `module.exports` and the config file have to be in the root folder (the one with your index.html), not in `node_modules`.

---

<div class="post-metadata">

**Author:** ![paolo6996](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@paolo6996](https://forum.freecodecamp.org/u/paolo6996)\
**Post date:** [June 14, 2021, 12:34am UTC](https://forum.freecodecamp.org/t/vs-code-live-sever-not-working/460192/13 "2021-06-14T00:34:12Z")

</div>

Just wanted to double check with you it’s supposed to be like this right? Chrome doesn’t look like it’s able to spawn.

 ![Screenshot 2021-06-13 8.16.22 PM](https://global.discourse-cdn.com/freecodecamp/original/3X/4/a/4ad59570801522d923ef3e0713a3d6bce7dbb00c.png)

 ![Screenshot 2021-06-13 8.25.08 PM](https://global.discourse-cdn.com/freecodecamp/original/3X/d/3/d3fac27f57bd7c19ceaeda855c983338e52816ca.png)

---

<div class="post-metadata">

**Author:** ![lasjorg](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/lasjorg/32/280761_2.png) [@lasjorg](https://forum.freecodecamp.org/u/lasjorg)\
**Post date:** [June 14, 2021, 6:13am UTC](https://forum.freecodecamp.org/t/vs-code-live-sever-not-working/460192/14 "2021-06-14T06:13:56Z")

</div>

Can you try using the debug, as I showed?

```auto
module.exports = {
  debugVSCode: true,
  browser: ["google chrome", "google-chrome", "google-chrome-stable", "chrome"],
};

```

---

<div class="post-metadata">

**Author:** ![paolo6996](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@paolo6996](https://forum.freecodecamp.org/u/paolo6996)\
**Post date:** [June 17, 2021, 2:39am UTC](https://forum.freecodecamp.org/t/vs-code-live-sever-not-working/460192/15 "2021-06-17T02:39:00Z")

</div>

Sorry I actually did that before but forgot to send it. Did I log it correctly? Still doesn’t seem to work.

 ![Screenshot 2021-06-16 10.36.54 PM](https://global.discourse-cdn.com/freecodecamp/original/3X/6/2/6292ab5e5e7bad85d82eff4414f2951327f89a84.png)

---

<div class="post-metadata">

**Author:** ![lasjorg](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/lasjorg/32/280761_2.png) [@lasjorg](https://forum.freecodecamp.org/u/lasjorg)\
**Post date:** [June 17, 2021, 3:28pm UTC](https://forum.freecodecamp.org/t/vs-code-live-sever-not-working/460192/16 "2021-06-17T15:28:16Z")

</div>

OK, so it just errors/crashes the minute it can’t spawn the process and doesn’t proceed to the next name in the array.

Not really sure what to say, one thing you might want to check is the [environment variable](https://www.google.com/search?q=environment+variable+Linux+Chrome) for Chrome. I think you would normally get that error if you tried running something that didn’t exist, but I’m guessing the lack of, or incorrect, environment variable might do the same (google [search for error](https://www.google.com/search?q=spawn+google+chrome+ENOENT+chromebook)).

Otherwise, I think maybe you should try opening an issue and hear what the author has to say about it.

---

<div class="post-metadata">

**Author:** ![paolo6996](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@paolo6996](https://forum.freecodecamp.org/u/paolo6996)\
**Post date:** [June 24, 2021, 6:27am UTC](https://forum.freecodecamp.org/t/vs-code-live-sever-not-working/460192/17 "2021-06-24T06:27:18Z")

</div>

Thanks for your prompt responses and help with this issue. I think I will open an issue with the author about this problem.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [December 23, 2021, 6:27pm UTC](https://forum.freecodecamp.org/t/vs-code-live-sever-not-working/460192/18 "2021-12-23T18:27:21Z")

</div>

Closed on December 23, 2021, 6:27pm UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
