【发布时间】:2020-05-19 05:58:33
【问题描述】:
我的 react 应用程序是使用 create react app https://reactjs.org/docs/create-a-new-react-app.html 构建的,无法启动。
当我执行 npm run start 时,我的应用程序挂起并显示以下消息。
正在启动开发服务器...
package.json
{
"name": "frontend",
"version": "0.1.0",
"private": true,
"dependencies": {
"@types/jest": "^25.1.1",
"@types/node": "^13.7.0",
"@types/react": "^16.9.19",
"@types/react-dom": "^16.9.5",
"@types/react-router-dom": "^5.1.3",
"axios": "^0.19.2",
"lodash": "^4.17.15",
"node-sass": "^4.13.1",
"npm-check-updates": "^4.0.1",
"qs": "^6.9.1",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-router-dom": "^5.1.2",
"react-scripts": "3.3.1",
"typescript": "^3.7.5"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@semantic-release/gitlab": "^6.0.2",
"semantic-release": "^17.0.2"
},
"release": {
"branch": "master",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/gitlab",
{
"gitlabUrl": "https://git.companyname.com"
}
]
]
}
}
节点版本:v12.14.1
npm 版本:6.13.4
我已经尝试了几次,每次失败都会创建一个新的节点进程,我知道这一点,因为它要求我选择不同的端口。
到目前为止,我已经尝试了以下过程,但没有任何运气
rm -rf node_modules
npm install
npm start
【问题讨论】:
-
你试过访问localhost:3000吗?
-
是的,我尝试访问 localhost:port (3000) 并且页面一直在不断加载
-
检查您的浏览器控制台
-
试试:
npm install npm@latest -g -
@demkovych 控制台中没有任何相关内容,页面未完成加载,所以我不确定您的期望