[英]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
file我
build
的dependencies
项和devDependencies
都位于root/package.json
中,需要将依赖项移动到app/package.json
文件中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.