无法访问http://192.168.56.1:3000

发布于 2025-01-25 02:47:52 字数 1413 浏览 2 评论 0原文

问题描述

我在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

荒人说梦 2025-02-01 02:47:53

我通过连接到http:// localhost:3000来解决问题,而不是http://192.168.56.1:3000。现在起作用。

I solved my problem by connecting to http://localhost:3000, instead of http://192.168.56.1:3000. Now it works.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文