Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在使用Electron+;克拉?_Electron_Create React App - Fatal编程技术网

如何在使用Electron+;克拉?

如何在使用Electron+;克拉?,electron,create-react-app,Electron,Create React App,我用CRA+电子。我通过targetelectron渲染器构建我的项目 它在加载build文件夹中的文件时运行良好,但在开发和加载urllocalhost:3000时出错 我猜原因是我在react组件中使用了node api和electron api。有人有解决办法吗?谢谢 TypeError:fs.existsSync不是函数 5 | var pathFile=path.join(uu dirname,'path.txt'); 6 | 7 |函数getElectronPath(){ >8 |

我用CRA+电子。我通过target
electron渲染器构建我的项目

它在加载build文件夹中的文件时运行良好,但在开发和加载url
localhost:3000
时出错

我猜原因是我在react组件中使用了node api和electron api。有人有解决办法吗?谢谢

TypeError:fs.existsSync不是函数
5 | var pathFile=path.join(uu dirname,'path.txt');
6 | 
7 |函数getElectronPath(){
>8 | if(fs.existsSync(路径文件)){
9 | var executablePath=fs.readFileSync(路径文件“utf-8”);
10 | 
11 | if(过程环境电子覆盖距离路径){

我不得不承认我有时是个傻瓜。当我加载url
localhost:3000
时,我又写了一个
。哈哈!我不得不承认我有时是个傻瓜。当我加载url
localhost:3000
时,我又写了一个
。哈哈!