1

When doing ember s on any ember app, I get:

Serving on http://localhost:4200/
Livereload failed on http://localhost:49152.  It is either in use or you do not have permission.

Checking the failing port with lsof -iTCP:49152 shows nothing. So I guess this must be a permission issue. I installed this on a new Mac using the setup suggested at https://stackoverflow.com/a/28025834/704499: brew install nvm, then nvm install 6.9.2, then npm install -g npm@latest.

I can start the server by using sudo ember s. But I can also start the server by explicitly assigning a different port for livereload – which doesn't make any sense given that nothing is blocking port 49152…

  • nodejs 6.9.2
  • nvm 0.32.1
  • npm 3.10.9
  • ember-cli 2.10.0

I'm confused as to what the exact cause of this problem is and how I can solve it. Any hints appreciated.

Community
  • 1
  • 1
morgler
  • 1,669
  • 1
  • 18
  • 26
  • Can you try to change the port by adding the following line to the `.ember-cli` file. "live-reload-port":49123 – ykaragol Dec 30 '16 at 12:41
  • Thanks @ykaragol, that works. Still strange, that `sudo ember s` works with the initial port and that nothing is blocking the initial port. – morgler Dec 30 '16 at 13:04

2 Answers2

3

It's related to the Touchbar on the new MacBook Pros. See details here: https://github.com/ember-cli/ember-cli/issues/6513

If you change the port that live reload is launching on (on mobile at the moment, so don't have an easy way to look that command up), you should be set.

acorncom
  • 5,975
  • 1
  • 19
  • 31
  • Wow, would have never guessed that the Touchbar could prevent my Ember server to start. Thanks! – morgler Jan 08 '17 at 17:12
  • 3
    You can start the server on a different port via `ember server --live-reload-port 35729`. But if you don't want to type this repeatedly, you can change the livereload port in your .ember-cli file: `{ "live-reload-port": 35729 }` – morgler Jan 08 '17 at 17:16
  • @morgler Should also be fixed in later versions of Ember-CLI (I'm assuming you're using 2.10?). If this helped, would you mind accepting my answer? – acorncom Jan 09 '17 at 17:32
  • fwiw, the issue continues to appear with ember-cli 2.11. Luckily, changing the port works. The GitHub issue cited by @acorncom was marked as closed several weeks ago, but it doesn't look like it is in fact resolved yet. – Kay V Jan 30 '17 at 16:59
1

To address this issue temporarily, start the server on a different port:

ember serve --live-reload-port 0

Per ember help: "Pass 0 to automatically pick an available port", which generally works both for --live-reload-port as well as for webserver port. Occasionally I get the same error, and specifying a port like 35729 does the trick.

A fix is also in the ember-cli pipeline; you can update to the beta branch to test:

npm install -g ember-cli@beta

Note: @acorncom pointed out that beta has a fix (github issue) and the original poster of the question, @morgler, shared specific instructions for the live reload port number change in a comment on this thread. My answer merely consolidates the info in one place, so credit where credit is due.

Kay V
  • 3,738
  • 2
  • 20
  • 20