Ember server port permission

1.9k views Asked by At

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.

2

There are 2 answers

4
acorncom On BEST ANSWER

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.

0
Kay V On

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.