3
votes

When running my ember application with ember serve -e local I get:

Port 4200 is already in use.

Which is weird because no application is running on 4200. I tried to open a dummy HTTP server on 4200 with http-server and it works just fine. It also works when I specify the port via a command line flag ember serve --port 4200.

Some things I've tried:

  • Restarted my computer.
  • Removed the node_modules.
  • Remove the ember tmp directory.
  • Disabled my firewall.
  • Tried with disabled wi-fi.

Any thoughts?


I'm running on masOS High Sierra 10.13.6 with the following versions:

  • node: 8.11.3
  • ember-cli: 2.18.2
  • npm: 5.6.0 (also tried with 6.3.0)

Also useful to know:

  • I have other ember applications running on my computer just fine.
  • I started to have this problem only recently.
  • In the past, macOS would keep asking me about authorizing incoming traffic whenever an app was opened, but now it stopped asking me.
2

2 Answers

1
votes

After further investigation, it seems that the problem is not coming from macOS, but from something messed up in the dependencies causing ember-cli to fail...

It's not quite clear what is causing this, and I will try to post any additional information here, but for now if you happen to encounter this problem, just pass the port value directly to ember-cli like so:

ember serve --port 4200

0
votes

I had this issue and tracked it down to using a string vs. integer for port in .ember-cli.

// .ember-cli
{
  "port": 8080, // works
  "port": "8080", // throws the error mentioned above
}

Not sure if this is the cause for others with this error. As mentioned, first thing is to make sure nothing else is actually running on that port. But OP had already checked that, and so had I.