node 版本大于17就有这个问题,解决方式是在package.json 中增加启动参数
"scripts": {
"electron": "electron .",
"start": "react-scripts --openssl-legacy-provider start",
"build": "react-scripts --openssl-legacy-provider build",
"test": "react-scripts --openssl-legacy-provider test",
"eject": "react-scripts --openssl-legacy-provider eject"
},
我测试的react,其他框架也类似操作。