4
我使用電子構建器(16.6.2)將我的電子應用程序打包,其中包括keytar(3.0.2)作爲prod依賴項。使用電子應用程序包裝Keytar
的package.json文件包括:
"scripts": {
"postinstall": "install-app-deps",
"compile:dev": "webpack-dev-server --hot --host 0.0.0.0 --config=./webpack.dev.config.js",
"compile": "webpack --config webpack.build.config.js",
"dist": "yarn compile && build"
},
"build": {
"appId": "com.myproject",
"asar": true,
"files": [
"bin",
"node_modules",
"main.js"
]
}
當我運行在同一系統上的。應用程序運行良好。當我嘗試在不同的系統上運行它(或刪除我的node_modules)時,它無法找到keytar.node。當建立keytar時,它會爲我的系統包含一個完全合格的映像。在控制檯中出現以下錯誤:
Uncaught Error: Cannot open /Users/Kevin/Work/myproject/node_modules/keytar/build/Release/keytar.node
Error: dlopen(/Users/Kevin/Work/myproject/node_modules/keytar/build/Release/keytar.node,
1): image not found
我必須缺少構建過程中的一個步驟。