简体   繁体   English

等待与 ionic serve 上的 react-scripts 连接

[英]Waiting for connectivity with react-scripts on ionic serve

I have an Ionic project, which works fine on my windows machine and friend's mac, but I got a problem on linux.我有一个 Ionic 项目,它在我的 windows 机器和朋友的 mac 上运行良好,但我在 linux 上遇到了问题。

The problem appears on ionic serve , it's infinitely Waiting for connectivity with react-scripts... , and appearing continues while it's running.问题出现在ionic serve上,它无限Waiting for connectivity with react-scripts... ,并且在运行时继续出现。 Development server seems to work fine.开发服务器似乎工作正常。

Hope, we'll find a solution.希望,我们会找到解决方案。

CLI output:命令行 output:

npm run start

> [project name]@0.0.1 start
> ionic serve

> react-scripts start
[react-scripts] ℹ 「wds」: Project is running at http://192.168.1.66/
[react-scripts] ℹ 「wds」: webpack output is served from 
[react-scripts] ℹ 「wds」: Content not from webpack is served from /[project path]/app/public
[react-scripts] ℹ 「wds」: 404s will fallback to /
[react-scripts] Starting the development server...
[react-scripts] 
[react-scripts] You can now view better-call in the browser.
[react-scripts]   Local:            http://localhost:8100
[react-scripts]   On Your Network:  http://192.168.1.66:8100
[react-scripts] Note that the development build is not optimized.
[react-scripts] To create a production build, use npm run build.
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...

I have same issue, because I used node 18, with 16 it's better.我有同样的问题,因为我使用了节点 18,使用 16 会更好。 You can resolve it with this:你可以用这个解决它:

  1. Install npm i n.在中安装 npm。

  2. Install older version of node, 16 works fine for me, then install it with this command -> n 16.安装旧版本的节点,16 对我来说很好,然后使用这个命令安装它 -> n 16。

  3. Change version of node that you want, just put n in your terminal, and then select the 16 node version, and use ionic serve again更改您想要的节点版本,只需将 n 放入您的终端,然后 select 16 节点版本,并再次使用 ionic serve

I hope this works for you.我希望这对你有用。

Best最好的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM