用于构建电子应用程序的 Svelte + 电容器 - 不工作

Svelte + Capacitor for build electron app - not working

使用 Svelte + Capacitor 构建电子应用程序时出现错误

node_modules/@types/fs-extra/index.d.ts:232:38 - error TS2694: Namespace '"fs"' has no exported member 'BaseEncodingOptions'.

232         (path: PathLike, options: fs.BaseEncodingOptions | BufferEncoding | undefined | null): Promise<string>;
                                         ~~~~~~~~~~~~~~~~~~~

node_modules/@types/fs-extra/index.d.ts:233:38 - error TS2694: Namespace '"fs"' has no exported member 'BufferEncodingOption'.

233         (path: PathLike, options: fs.BufferEncodingOption): Promise<Buffer>;
                                         ~~~~~~~~~~~~~~~~~~~~

node_modules/@types/fs-extra/index.d.ts:234:38 - error TS2694: Namespace '"fs"' has no exported member 'BaseEncodingOptions'.

234         (path: PathLike, options: fs.BaseEncodingOptions | string | undefined | null): Promise<string | Buffer>;

你可以直接 cd 到 electron 文件夹,

run npm install --save @types/fs-extra@9.0.7

然后是运行

electron npm run electron:start