我试着用
电子锻造
按照选项提交到Mac应用商店(MAS)
使用特定于应用程序的密码
中提到
Electron forge official guide
,但遇到错误-
“无法将您的应用程序与代码绑定:66。无法下载票证。必须设置CDHash。“
我的应用程序的forge.config.js文件如下所示(确保appleId、appleIdPassword和teamId为accarte):
module.exports = {
packagerConfig: {
osxSign: {},
osxNotarize: {
tool: 'notarytool',
appleId: '******',
appleIdPassword: '******',
teamId: '******',
}
},
rebuildConfig: {},
makers: [
{
name: '@electron-forge/maker-squirrel',
config: {},
},
{
name: '@electron-forge/maker-zip',
platforms: ['darwin'],
},
{
name: '@electron-forge/maker-deb',
config: {},
},
{
name: '@electron-forge/maker-rpm',
config: {},
},
],
};
我的Node.js应用程序的package.json有如下脚本:
"scripts": {
"start": "electron-forge start",
"package": "electron-forge package",
"make": "electron-forge make"
},
但在执行npm时,运行make to do代码签名并生成应用程序,在多次重试时重复遇到以下错误:
An unhandled rejection has occurred inside Forge:
Error: Failed to staple your application with code: 66
Processing: /private/var/folders/h3/vkfpv17950z45hg1z5tjfq000000gn/T/electron-packager/darwin-x64/myapp-darwin-x64-wgLqgW/myapp.app
Properties are {
    NSURLIsDirectoryKey = 1;
    NSURLIsPackageKey = 1;
    NSURLIsSymbolicLinkKey = 0;
    NSURLLocalizedTypeDescriptionKey = Application;
    NSURLTypeIdentifierKey = "com.apple.application-bundle";
    "_NSURLIsApplicationKey" = 1;
}
Props are {
}
Cannot download ticket. CDHash must be set.
at Object.<anonymous> (/path/myapp/node_modules/@electron/notarize/lib/staple.js:22:19)
    at Generator.next (<anonymous>)
    at fulfilled (/path/myapp/node_modules/@electron/notarize/lib/staple.js:4:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
你能帮忙调试失败的原因吗?