无法访问http://192.168.56.1:3000
问题描述
我在nuxt.js中具有vue.js的前端应用程序。我以开发人员模式运行应用程序 命令纱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
我尝试的
- 我创建了新的Vue应用程序,并且在浏览器上效果很好。
- 我检查了ping:
>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
杀死端口后,我收到的错误命令失败了。
。,所以我重新启动了该应用程序。
问题在哪里?为什么该应用程序在浏览器中不起作用?
Problem description
I have a frontend application in Nuxt.js with Vue.js. I run the application in developer mode with
command yarn dev
. Compiled successfully:
No issues found.
Waiting for file changes
Memory usage: 1.17 GB (RSS: 1.36 GB)
Listening on: http://192.168.56.1:3000/
I opened it in a browser and I got error:
This site cannot be reached.
The server 192.168.56.1 took too long to respond.
ERR_CONNECTION_TIMED_OUT
What I tried
- I created new vue app and it worked fine on browser.
- I checked the ping:
>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
- I checked the port:
>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
After killed port I received error Command failed with exit code 1.
So I restarted the application.
Where is the problem? Why the application not working in the browser?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过连接到
http:// localhost:3000
来解决问题,而不是http://192.168.56.1:3000
。现在起作用。I solved my problem by connecting to
http://localhost:3000
, instead ofhttp://192.168.56.1:3000
. Now it works.