我已经研究了一段时间,成功地使用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。它也只是永远加载。
我在同一个端口上尝试了另一个项目,它成功了,所以它看起来不像是端口的问题。
这是我的package.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"
]
}
}有人知道会出什么问题吗?
发布于 2022-06-16 14:51:43
数据不够。但是其中一个原因可能是在某个时候端口3000没有被正确释放。尝试通过端口终止进程,或者简单地重新启动系统。
https://stackoverflow.com/questions/72647395
复制相似问题