我使用的MacBook Air M2(索诺马14.0)与电子版本27.0.3
我试图运行electron-forge make
为Electron应用程序制作可分发文件。但在启动命令时,我得到以下错误:
✔ Checking your system
✔ Loading configuration
✔ Resolving make targets
› Making for the following targets: zip, dmg
✔ Running package command
✔ Preparing to package application
✔ Running packaging hooks
✔ Running generateAssets hook
✔ Running prePackage hook
✔ [plugin-webpack] Preparing native dependencies
✔ [plugin-webpack] Building webpack bundles
✔ Packaging application
✔ Packaging for x64 on darwin [3s]
✔ Running postPackage hook
✔ Running preMake hook
❯ Making distributables
✔ Making a zip distributable for darwin/x64 [11s]
✖ Making a dmg distributable for darwin/x64
› Command failed: bless --folder /Volumes/ApplicationName --openfolder /Volumes/ApplicationName
bless: The 'openfolder' is not supported on Apple Silicon devices.
◼ Running postMake hook
An unhandled rejection has occurred inside Forge:
Error: Command failed: bless --folder /Volumes/ApplicationName --openfolder /Volumes/ApplicationName
bless: The 'openfolder' is not supported on Apple Silicon devices.
at makeError (/Users/elerua/Code/CE-mainrepo/Frontend/node_modules/appdmg/node_modules/execa/index.js:174:9)
at /Users/elerua/Code/CE-mainrepo/Frontend/node_modules/appdmg/node_modules/execa/index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
字符串
我根据文档在package.json
文件中添加了多个maker:
"makers": [
{
"name": "@electron-forge/maker-squirrel",
"config": {
"name": APPLICATION_NAME,
"setupIcon": APPLICATION_ICON
}
},
{
"name": "@electron-forge/maker-zip",
"config": {
"name": APPLICATION_NAME
},
"platforms": [
"darwin"
]
},
{
"name": "@electron-forge/maker-dmg",
"config": {
"name": APPLICATION_NAME,
"setupIcon": APPLICATION_ICON,
"format": "ULFO"
}
},
{
"name": "@electron-forge/maker-deb",
"config": {
"name": APPLICATION_NAME,
"setupIcon": APPLICATION_ICON
}
},
{
"name": "@electron-forge/maker-rpm",
"config": {
"name": APPLICATION_NAME,
"setupIcon": APPLICATION_ICON
}
}
]
型
我一直在互联网上搜索多种方法来解决这个问题,但找不到任何帮助。
1条答案
按热度按时间jqjz2hbq1#
我终于找到了无法通过帖子看到的解决方案。我电脑上使用的默认Node.js是为x64而不是arm64构建的v18.X.X。一旦安装了正确的Node.js版本,我就可以追求
electron-forge make
了。提示
字符串