问题描述
我在Nuxt.js中有一个带有Vue.js的前端应用程序。我使用命令yarn dev
在开发人员模式下运行应用程序。成功汇编:
No issues found.
Waiting for file changes
Memory usage: 1.17 GB (RSS: 1.36 GB)
Listening on: http://192.168.56.1:3000/
我在浏览器中打开它,发现了错误:
This site cannot be reached.
The server 192.168.56.1 took too long to respond.
ERR_CONNECTION_TIMED_OUT
我试过什么
>ping 192.168.56.1
Pinging 192.168.56.1 with 32 bytes of data:
Reply from 192.168.56.1: bytes=32 time<1ms TTL=128
Reply from 192.168.56.1: bytes=32 time<1ms TTL=128
Reply from 192.168.56.1: bytes=32 time<1ms TTL=128
Reply from 192.168.56.1: bytes=32 time<1ms TTL=128
Ping statistics for 192.168.56.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
>netstat -ano | findstr :3000
TCP 0.0.0.0:3000 0.0.0.0:0 LISTENING 11920
>npx kill-port 3000
Need to install the following packages:
kill-port
Ok to proceed? (y) y
Process on port 3000 killed
在关闭端口后,我收到了error Command failed with exit code 1.
,所以我重新启动了应用程序。
,问题出在哪里?为什么应用程序不能在浏览器中工作?
发布于 2022-04-28 11:02:48
我通过连接到http://localhost:3000
而不是http://192.168.56.1:3000
来解决我的问题。现在起作用了。
https://stackoverflow.com/questions/72040615
复制相似问题