2

节点 v8.11 NPM v5.6

每当我尝试调用 polymer serve 时,都会发生错误,告知服务器无法启动并且没有可用端口,这是错误的!大多数端口都可用。

$ 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>

这是一个--verbose错误日志文本http://freetexthost.com/2sjgr45yx5 我在 Mac 上,我通过包安装程序形式安装了节点那里的网站

4

1 回答 1

1

正如@synk 在评论中所说:

polymer serve --hostname 0.0.0.0 或将 0.0.0.0 替换为机器上可用的 IP

于 2018-04-05T08:44:38.313 回答