早上好,
我在 Vue JS 中创建了一个程序,它与我在 main.js 文件中创建的 API 连接以执行系统命令.
I have created a program in Vue JS, this connects with an API that I have created in a main.js file to execute system commands.
我遇到的问题是,使用电子进行生产编译时出现以下错误:
The problem I have is that when compiling for production with electron I get the following error:
我使用命令 npm run electron: build
I use the command npm run electron: build
当我使用 npm run electron:serve work 时没有问题
When I use npm run electron:serve work without problems
有人知道为什么会出现错误以及如何解决吗?谢谢
Anyone have any idea why is the error and how to fix it? Thanks
我前几天也遇到过这个问题.我意识到试图解决另一个问题,我删除了 node_modules 文件夹和 package-lock.json 文件,然后运行 npm install 命令.这使得构建因fs/promises"而失败.这个问题有两种解决方案:
I experienced this issue a few days ago as well. I realized that trying to fix another issue, I deleted the node_modules folder and the package-lock.json file, then run the npm install command. This made the build to fail with 'fs/promises'. There are 2 solutions to this issue:
node_modules 文件夹并恢复旧的 package-lock.json 文件,以确保包版本保持不变.然后运行 npm install 命令,问题应该就解决了.node_modules folder and bring back the old package-lock.json file to ensure that the package versions remain the same. Then run the npm install command and the issue should be fixed.这篇关于找不到模块“fs/promises"Electron JS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
在 Electron 渲染器进程中创建子窗口时如何修复How to fix BrowserWindow is not a constructor error when creating child window in Electron renderer process(在 Electron 渲染器进程中创建子窗口
Electron webContents executeJavaScript:无法在第二个 loaElectron webContents executeJavaScript : Cannot execute script on second on loadURL(Electron webContents executeJavaScript:无法在第二个 loadURL 上
如何在angular-cli的组件内使用电子浏览器窗口?how to use electron browser window inside components in angular-cli?(如何在angular-cli的组件内使用电子浏览器窗口?)
ElectronJS - 在 Windows 之间共享 redux 存储?ElectronJS - sharing redux store between windows?(ElectronJS - 在 Windows 之间共享 redux 存储?)
如何在电子应用程序中访问相机/网络摄像头?How to access camera/webcamera inside electron app?(如何在电子应用程序中访问相机/网络摄像头?)
如何通过电子应用程序中的 navigator.geolocation 获取How to getCurrentPosition via navigator.geolocation in Electron app?(如何通过电子应用程序中的 navigator.geolocation 获取当前位置?)