首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法访问http://192.168.56.1:3000

无法访问http://192.168.56.1:3000
EN

Stack Overflow用户
提问于 2022-04-28 08:44:29
回答 1查看 139关注 0票数 0

问题描述

我在Nuxt.js中有一个带有Vue.js的前端应用程序。我使用命令yarn dev在开发人员模式下运行应用程序。成功汇编:

代码语言:javascript
运行
复制
No issues found.
Waiting for file changes
Memory usage: 1.17 GB (RSS: 1.36 GB)
Listening on: http://192.168.56.1:3000/

我在浏览器中打开它,发现了错误:

代码语言:javascript
运行
复制
This site cannot be reached. 
The server 192.168.56.1 took too long to respond.
ERR_CONNECTION_TIMED_OUT

我试过什么

  • 我创建了新的vue应用程序,它在浏览器上运行良好。
  • 我检查了ping:

代码语言:javascript
运行
复制
>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

  • 我检查了端口:

代码语言:javascript
运行
复制
>netstat -ano | findstr :3000
  TCP    0.0.0.0:3000           0.0.0.0:0              LISTENING       11920
代码语言:javascript
运行
复制
>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.,所以我重新启动了应用程序。

,问题出在哪里?为什么应用程序不能在浏览器中工作?

EN

Stack Overflow用户

发布于 2022-04-28 11:02:48

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

票数 0
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72040615

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档