简体   繁体   English

如何分发使用电子构建器构建的构建可执行文件

[英]How to distribute a built executable constructed using electron-builder

I have recently packaged an electron app using electron-builder:我最近使用电子生成器打包了一个 electron 应用程序:

myProject/
├── package.json
├── app/
└── release/

All files created by electron-builder are place in the release directory. electron-builder 创建的所有文件都放在发布目录中。 The executable works fine on my local machine, with all features present through the packaged app.可执行文件在我的本地机器上运行良好,所有功能都通过打包的应用程序提供。

However, once I move the application to another machine only some features are available.但是,一旦我将应用程序移动到另一台机器上,就只有一些功能可用。 Noticeably features within subdirectories in app/ are not included.值得注意的是,app/ 子目录中的功能不包括在内。

For example here a snippet of the app/ directory:例如这里 app/ 目录的片段:

app/
├── app.html
├── index.js
├── components/
└── other files and folders

Features added from.js/.html files within components/ are not present when I move the app to another machine.当我将应用程序移动到另一台机器时,components/ 中从 .js/.html 文件添加的功能不存在。 I have tried both moving just the executable as well as the whole release/ directory, neither includes additional features beyond what is included in app.html.我已经尝试过只移动可执行文件和整个 release/ 目录,它们都不包括 app.html 中包含的其他功能。

Update更新

It does indeed look like any other machine simply doesn't read items contained in它确实看起来像任何其他机器根本不读取包含在

<script></script>

In my app.html file在我的 app.html 文件中

Would there be some outside installation I need to do on another machine to get this executable running是否需要在另一台机器上进行一些外部安装才能使该可执行文件运行

Found the issue,发现问题,

It involved my usage of a two package.json structure它涉及我对两个package.json结构的使用

Both dependencies and devDependencies of my build were located in the root/package.json , where dependencies needed to be moved to the app/package.json filebuilddependencies项和devDependencies都位于root/package.json中,需要将依赖项移动到app/package.json文件中

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

相关问题 在电子锻造 + webpack 应用程序中使用电子构建器构建的应用程序显示空白屏幕 - App built using electron-builder in electron-forge + webpack application shows blank screen 使用 Electron-builder 构建 Electron 应用程序时如何包含本地可执行文件 - How to include a local executable when building an Electron app with Electron-builder 在使用electronic-builder构建的电子应用程序中包含Bootstrap - Including Bootstrap in an electron app built with electron-builder 如何使用电子生成器将 v8 快照打包到 exe 中? - How to pack v8 snapshot into exe using electron-builder? 如何使用电子生成器 package 预编译二进制文件 - How to package precompiled binary with electron-builder 如何向电子生成器注册.dll - How to register a .dll with electron-builder 使用电子生成器将文件夹和其中的文件包含到电子构建中? - Include a folder and the files inside it to electron build using electron-builder? 如何在Electron-builder中使用相对路径包含Node.js模块 - How to include a Node.js module using a relative path with Electron-builder 使用electron-builder时如何修改app.asar的文件夹结构? - How to modify the folder structure of app.asar when using electron-builder? 使用 electron-builder 导入用户 js 文件时出错 - Error importing a user js file using electron-builder
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM