离子服务命令卡在“ [react-scripts] 文件已成功发出,等待类型检查结果...”

Posted

技术标签:

【中文标题】离子服务命令卡在“ [react-scripts] 文件已成功发出,等待类型检查结果...”【英文标题】:Ionic serve command get stuck in " [react-scripts] Files successfully emitted, waiting for typecheck results..." 【发布时间】:2020-08-25 11:35:48 【问题描述】:

我正在尝试使用 CLI 创建一个包含 Ionic 和 React 的项目。我注意到这个错误出现在 Typescript 检查步骤中。

我一直在尝试以下方法来解决它:

    删除 node_modules 和 package-lock.json npm cache clear --force 将 Typescript 版本降级到 3.3.3333(大多数遇到相同问题的用户都用这个解决了) npm i ionic serve

但它一直向我显示相同的提示 [react-scripts] Files successfully emitted, waiting for typecheck results...

依赖关系:

"@capacitor/core": "2.1.0",
"@ionic/react": "^5.0.7",
"@ionic/react-router": "^5.0.7",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.4.0",
"@testing-library/user-event": "^8.0.3",
"@types/jest": "^24.0.25",
"@types/node": "^12.12.24",
"@types/react": "^16.9.17",
"@types/react-dom": "^16.9.4",
"@types/react-router": "^5.1.4",
"@types/react-router-dom": "^5.1.3",
"ionicons": "^5.0.0",
"react": "^16.13.0",
"react-dom": "^16.13.0",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"react-scripts": "3.4.1",
"typescript": "3.3.3333"

我还能做什么?

【问题讨论】:

【参考方案1】:

降级到 react-scripts 3.4.0

npm uninstall react-scripts -S
npm i react-scripts@3.4.0

ionic serve

【讨论】:

【参考方案2】:

见解

如果我使用 localhost:8100 打开一个选项卡,它可以工作(即使是热重载),但是离子服务本身不会打开一个窗口,并且终端中的提示仍然相同

【讨论】:

可以在react-scripts@3.4.3 上确认。控制台输出并没有指明应用在哪个端口上运行,也没有自动打开浏览器窗口,但应用确实运行正常。

以上是关于离子服务命令卡在“ [react-scripts] 文件已成功发出,等待类型检查结果...”的主要内容,如果未能解决你的问题,请参考以下文章

无法启动 MongoDB 服务器“react-scripts”未被识别为内部或外部命令

“react-scripts start”之后的顺序 NPM 脚本

sh: react-scripts: 运行 npm start 后找不到命令

create-react-app + npm start - 'react-scripts' 未被识别为内部或外部命令

离子服务工作有效,但运行 android 失败

Firebase电话身份验证中的“找不到主机名匹配”错误(使用离子)