2

Node v8.11 NPM v5.6

Whenever I try to call polymer serve an error occurs telling that server failed to start and no available ports, which is wrong! most of the ports are available.

$ polymer serve
ERROR: Server failed to start: Error: No available ports. Ports tried: [8081,8000,8001,8003,8031,2000,2001,2020,2109,2222,2310,3000,3001,3030,3210,3333,4000,4001,4040,4321,4502,4503,4567,5000,5001,5050,5432,6000,6001,6060,6666,6543,7000,7070,7774,7777,8765,8777,8888,9000,9001,9080,9090,9876,9877,9999,49221,55001]
    at /Users/nabed/.config/yarn/global/node_modules/polyserve/lib/start_server.js:380:15
    at Generator.next (<anonymous>)
    at fulfilled (/Users/nabed/.config/yarn/global/node_modules/polyserve/lib/start_server.js:17:58)
    at <anonymous>
error:   cli runtime exception: Error: Error: No available ports. Ports tried: [8081,8000,8001,8003,8031,2000,2001,2020,2109,2222,2310,3000,3001,3030,3210,3333,4000,4001,4040,4321,4502,4503,4567,5000,5001,5050,5432,6000,6001,6060,6666,6543,7000,7070,7774,7777,8765,8777,8888,9000,9001,9080,9090,9876,9877,9999,49221,55001]
error:   Error: Error: No available ports. Ports tried: [8081,8000,8001,8003,8031,2000,2001,2020,2109,2222,2310,3000,3001,3030,3210,3333,4000,4001,4040,4321,4502,4503,4567,5000,5001,5050,5432,6000,6001,6060,6666,6543,7000,7070,7774,7777,8765,8777,8888,9000,9001,9080,9090,9876,9877,9999,49221,55001]
    at /Users/nabed/.config/yarn/global/node_modules/polyserve/lib/start_server.js:91:19
    at Generator.throw (<anonymous>)
    at rejected (/Users/nabed/.config/yarn/global/node_modules/polyserve/lib/start_server.js:18:65)
    at <anonymous>

here is a --verbose err log text http://freetexthost.com/2sjgr45yx5 I am on mac, I installed node via package installer form there website

Suhayb
  • 3,163
  • 3
  • 23
  • 30
  • 1
    Try running with `--verbose` to see if any useful log messages appear that could help troubleshoot. – tony19 Apr 02 '18 at 14:36
  • @tony19 It worked then it is back to throw (no available ports) error again, I made the edit to the post by attaching a link holds --verbose output – Suhayb Apr 03 '18 at 07:56
  • 1
    Try `polymer serve --hostname 0.0.0.0` or replace `0.0.0.0` with an IP that is available on the machine. – synk Apr 03 '18 at 08:05
  • @synk That worked thanks, but curious to know why it struggles on localhost – Suhayb Apr 03 '18 at 08:09

1 Answers1

1

As @synk said on the comment:

polymer serve --hostname 0.0.0.0 or replace 0.0.0.0 with an IP that is available on the machine

Suhayb
  • 3,163
  • 3
  • 23
  • 30