请教Electron打包总是出错,什么办?
请教Electron打包总是出错,什么办?
出错提示:
出错日志内容:
`0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'packager'
1 verbose cli ]
2 info using npm@6.12.0
3 info using node@v12.13.0
4 verbose run-script [ 'prepackager', 'packager', 'postpackager' ]
5 info lifecycle administrator@14.0.6~prepackager: administrator@14.0.6
6 info lifecycle administrator@14.0.6~packager: administrator@14.0.6
7 verbose lifecycle administrator@14.0.6~packager: unsafe-perm in lifecycle true
8 verbose lifecycle administrator@14.0.6~packager: PATH: C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecyclenode-gyp-bin;C:UsersAdministratornwnode_modules.bin;C:Python27;C:Python27Scripts;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:WINDOWSSystem32OpenSSH;C:Program Filesnodejs;C:ProgramDatachocolateybin;C:UsersAdministratorAppDataLocalMicrosoftWindowsApps;C:UsersAdministratorAppDataRoamingnpm;C:UsersAdministratorAppDataLocalProgramsMicrosoft VS Codebin
9 verbose lifecycle administrator@14.0.6~packager: CWD: C:UsersAdministratornw
10 silly lifecycle administrator@14.0.6~packager: Args: [
10 silly lifecycle '/d /s /c',
10 silly lifecycle 'electron-packager ./nw administrator --win --out ./nw --arch=x64 --electron-version=14.0.6 --overwrite --ignore=node_modules --icon=ico.ico'
10 silly lifecycle ]
11 silly lifecycle administrator@14.0.6~packager: Returned: code: 1 signal: null
12 info lifecycle administrator@14.0.6~packager: Failed to exec packager script
13 verbose stack Error: administrator@14.0.6 packager: electron-packager ./nw administrator --win --out ./nw --arch=x64 --electron-version=14.0.6 --overwrite --ignore=node_modules --icon=ico.ico
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecycleindex.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:210:5)
13 verbose stack at ChildProcess.<anonymous> (C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecyclelibspawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:210:5)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid administrator@14.0.6
15 verbose cwd C:UsersAdministratornw
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "packager"
18 verbose node v12.13.0
19 verbose npm v6.12.0
20 error code ELIFECYCLE
21 error errno 1
22 error administrator@14.0.6 packager: electron-packager ./nw administrator --win --out ./nw --arch=x64 --electron-version=14.0.6 --overwrite --ignore=node_modules --icon=ico.ico
22 error Exit status 1
23 error Failed at the administrator@14.0.6 packager script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
配置文件
`{
"name": "your-app",
"version": "0.1.0",
"main": "index.js",
"scripts": {
"start": "electron ."
}
}`
`
新的问题来了,感觉要绝望了,好多天了,查了好多资料越弄越感觉这玩意就是个反人类的东西。现在感觉我连安装都没安装好。。。。。但为什么到处都有人说这玩意是多么多么的好,感觉简直就是最难学的东西。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
应该是你
C:\Users\xxx\AppData\Local\Temp
没有写入和修改权限,使用管理员权限看看scripts
增加"build": "electron-packager ."
然后运行yarn build
,npm
也可以,只是太慢