如何在Linux上运行打包的电子应用程序? [英] How to run packaged electron app on linux?

查看:116
本文介绍了如何在Linux上运行打包的电子应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有使用过太多Linux,但是我正在尝试运行一个使用电子打包程序打包的应用程序。

I haven't used Linux much but I'm trying to run an application which I've packaged using electron-packager.

因此在Linux上,我可以运行 npm start ,我的应用程序可以正常运行。但是,当我打包时,似乎没有安装程序或任何东西。打包并在Windows上运行正常。

So while on Linux, I can run npm start and my app works fine. But when I package it, there doesn't seem to be an installer or anything. Packaging and running on Windows work fine.

我使用以下方式打包:

npm run package-linux

按要求编辑:

我正在使用Linux mint-19.1-cinnamon-64bit。

I'm using Linux mint-19.1-cinnamon-64bit.

我使用的打包脚本是

"package-linux": "electron-packager . electron-tutorial-app --overwrite --asar=true --platform=linux --arch=x64 --icon=assets/icons/png/icon.png --prune=true --out=release-builds"

运行 npm run package-linux 成功完成,并生成一个名为 electron-tutorial-app-linux-x64

Running the npm run package-linux completes successfully and produces a folder called electron-tutorial-app-linux-x64 in a release-builds folder.

推荐答案

显然,Electron的最新版本以共享库格式输出打包的应用程序在Linux上,文件管理器无法将其识别为可执行文件。我发现此答案充分说明了为什么会发生此问题以及解决该问题的不同方法: https://stackoverflow.com/a/55064060/ 4774167

Apparently, recent versions of Electron output the packaged app in a "shared library" format on Linux, which the file managers don't recognize as an executable. I found this answer sufficiently explained why this issue occurs and different ways to work around it: https://stackoverflow.com/a/55064060/4774167

这篇关于如何在Linux上运行打包的电子应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆