我已经使用React有一段时间了,成功地使用npm start
查看了我的应用程序是如何运行的。
在某个时候,我的应用程序在http://localhost:3000/
停止加载。
我在候机厅看到这个:
Compiled successfully!
You can now view contact-list in the browser.
Local: http://localhost:3000
On Your Network: http://192.168.1.16:3000
Note that the development build is not optimized.
To create a production build, use npm run build.
在我的Chrome浏览器中,它看起来像是一直在加载,没有显示任何错误。
我试过删除浏览器缓存。
我试着检查http://192.168.1.16:3000
。它也只是永久加载。
我在同一个端口上尝试了另一个项目,它工作正常,所以看起来不像是端口的问题。
这是我的包裹json:
{
"name": "contact-list",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.10",
"@testing-library/react": "^11.2.6",
"@testing-library/user-event": "^12.8.3",
"bootstrap": "^5.1.3",
"react": "^18.1.0",
"react-dom": "^17.0.2",
"react-router-dom": "^6.3.0",
"react-scripts": "4.0.3",
"web-vitals": "^1.1.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
有人知道哪里出了问题吗?
2条答案
按热度按时间km0tfn4u1#
数据不足。但原因之一可能是端口3000在某个时候没有正确释放。请尝试通过端口终止进程,或简单地重新启动系统
5vf7fwbs2#
也许您可以查找防火墙设置