英文:
Electron Forge issue: "cannot make for linux and target deb"
问题
我再次遇到了问题,但无法解决...
问题
我有一个Electron应用程序,想要为Linux构建它。到目前为止,我已经成功创建了一个Windows(Squirrel)构建版本,但当我从虚拟机执行相同的命令时,出现以下错误:
cannot make for linux and target deb: the maker declared that it cannot run on linux
Forge配置
module.exports = {
packagerConfig: {
asar: true,
linux: {
target: 'deb',
}
},
rebuildConfig: {},
makers: [
{
name: '@electron-forge/maker-squirrel',
config: {
authors: 'Sample author',
description: 'Some description'
},
},
{
name: '@electron-forge/maker-zip',
platforms: ['darwin'],
},
{
name: '@electron-forge/maker-deb',
config: {
authors: 'Sample author',
description: 'Some description',
"name": "app",
"category": "Games"
},
},
{
name: '@electron-forge/maker-rpm',
config: {},
},
],
plugins: [
{
name: '@electron-forge/plugin-auto-unpack-natives',
config: {},
},
],
};
我原本期望收到一个好的.deb文件,但我却得到了这个错误...
英文:
I'm once again facing an issue and I can't get out of it...
The problem
I have an Electron app and I want to build it for linux. So far, I've succeed to create a Windows (Squirrel) build for it, but when I execute the same command from a virtual machine, it gives this error:
cannot make for linux and target deb: the maker declared that it cannot run on linux
Forge configuration
module.exports = {
packagerConfig: {
asar: true,
linux: {
target: 'deb',
}
},
rebuildConfig: {},
makers: [
{
name: '@electron-forge/maker-squirrel',
config: {
authors: 'Sample author',
description: 'Some description'
},
},
{
name: '@electron-forge/maker-zip',
platforms: ['darwin'],
},
{
name: '@electron-forge/maker-deb',
config: {
authors: 'Sample author',
description: 'Some description',
"name": "app",
"category": "Games"
},
},
{
name: '@electron-forge/maker-rpm',
config: {},
},
],
plugins: [
{
name: '@electron-forge/plugin-auto-unpack-natives',
config: {},
},
],
};
I was expecting to receive a nice .deb file, but I got that error...
答案1
得分: 2
我已解决!
解决方案
作者和描述设置必须放在引号中,如下所示:
"authors":"test",
"description":"some desc"
完整配置
module.exports = {
packagerConfig: {
asar: true,
linux: {
target: 'deb',
}
},
rebuildConfig: {},
makers: [
{
name: '@electron-forge/maker-squirrel',
config: {
authors: 'Sample author',
description: 'Some description'
},
},
{
name: '@electron-forge/maker-zip',
platforms: ['darwin'],
},
{
name: '@electron-forge/maker-deb',
config: {
"authors": 'Sample author',
"description": 'Some description',
"name": "app",
"category": "Games"
},
},
{
name: '@electron-forge/maker-rpm',
config: {},
},
],
plugins: [
{
name: '@electron-forge/plugin-auto-unpack-natives',
config: {},
},
],
};
英文:
I resolved!
Solution
authors and description setting has to be under quotes, like so:
"authors":"test",
"description":"some desc"
Full configuration
module.exports = {
packagerConfig: {
asar: true,
linux: {
target: 'deb',
}
},
rebuildConfig: {},
makers: [
{
name: '@electron-forge/maker-squirrel',
config: {
authors: 'Sample author',
description: 'Some description'
},
},
{
name: '@electron-forge/maker-zip',
platforms: ['darwin'],
},
{
name: '@electron-forge/maker-deb',
config: {
"authors": 'Sample author',
"description": 'Some description',
"name": "app",
"category": "Games"
},
},
{
name: '@electron-forge/maker-rpm',
config: {},
},
],
plugins: [
{
name: '@electron-forge/plugin-auto-unpack-natives',
config: {},
},
],
};
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论