Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit Code 4 and 2 - sips error - builds failing - libglib-2.0.0.dylib missing #2204

Closed
alphadijkstra opened this issue Oct 15, 2017 · 6 comments

Comments

@alphadijkstra
Copy link

  • Version: 19.37.2
  • Targets: MacOS (DMG), Linux (AppImage) and Windows (NSIS - ia32 & x64)

I'm trying to build my project on MacOS 10.13 but I keep getting the same errors.
Building for Windows works on Windows and building for MacOS works on MacOS but when I want to target all platforms from MacOS then it fails.

I couldn't find any post with someone that had the same issue.

It seems to depend on sips not being able to convert the icons correctly.
My original icons are one icon.icns and icon.ico. Like the documentation states, linux building should automatically convert the icons from icns to the correct format. Maybe this fails here?

Error log:

No native production dependencies
Packaging for linux x64 using electron 1.6.15 to ../app - Distribution/linux-unpacked
Unhandled rejection Error: Exit code: 4. Command failed: sips --resampleHeightWidth 64 64 /private/var/folders/g2/xvz16l791h11py_dsnw7nrj80000gn/T/temp-files-FPxVgW/1.iconset/icon_256x256.png --out /private/var/folders/g2/xvz16l791h11py_dsnw7nrj80000gn/T/temp-files-FPxVgW/1.iconset/icon_64x64.png
Warning: /private/var/folders/g2/xvz16l791h11py_dsnw7nrj80000gn/T/temp-files-FPxVgW/1.iconset/icon_256x256.png not a valid file - skipping
Error 4: no file was specified
Try 'sips --help' for help using this tool

Warning: /private/var/folders/g2/xvz16l791h11py_dsnw7nrj80000gn/T/temp-files-FPxVgW/1.iconset/icon_256x256.png not a valid file - skipping
Error 4: no file was specified
Try 'sips --help' for help using this tool

    at /Users/joe/app-cross-platform/node_modules/builder-util/src/util.ts:116:16
    at ChildProcess.exithandler (child_process.js:205:5)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:920:16)
    at Socket.<anonymous> (internal/child_process.js:351:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:497:12)
From previous event:
    at exec (/Users/joe/app-cross-platform/node_modules/builder-util/src/util.ts:84:3)
    at resizeImage (/Users/joe/app-cross-platform/node_modules/electron-builder/src/targets/LinuxTargetHelper.ts:260:12)
    at resize (/Users/joe/app-cross-platform/node_modules/electron-builder/src/targets/LinuxTargetHelper.ts:180:75)
    at /Users/joe/app-cross-platform/node_modules/electron-builder/src/targets/LinuxTargetHelper.ts:186:21
    at next (native)
    at go$readdir$cb (/Users/joe/app-cross-platform/node_modules/graceful-fs/graceful-fs.js:149:14)
From previous event:
    at LinuxTargetHelper.createFromIcns (/Users/joe/app-cross-platform/node_modules/electron-builder/out/targets/LinuxTargetHelper.js:236:11)
    at /Users/joe/app-cross-platform/node_modules/electron-builder/src/targets/LinuxTargetHelper.ts:58:25
    at next (native)
    at FSReqWrap.oncomplete (fs.js:123:15)
From previous event:
    at LinuxTargetHelper.computeDesktopIcons (/Users/joe/app-cross-platform/node_modules/electron-builder/out/targets/LinuxTargetHelper.js:88:11)
    at new LinuxTargetHelper (/Users/joe/app-cross-platform/node_modules/electron-builder/src/targets/LinuxTargetHelper.ts:23:23)
    at getHelper (/Users/joe/app-cross-platform/node_modules/electron-builder/src/linuxPackager.ts:33:18)
    at outDir (/Users/joe/app-cross-platform/node_modules/electron-builder/src/linuxPackager.ts:62:122)
    at mapper (/Users/joe/app-cross-platform/node_modules/electron-builder/src/targets/targetFactory.ts:49:16)
    at LinuxPackager.createTargets (/Users/joe/app-cross-platform/node_modules/electron-builder/src/linuxPackager.ts:62:7)
    at createTargets (/Users/joe/app-cross-platform/node_modules/electron-builder/src/targets/targetFactory.ts:56:12)
    at /Users/joe/app-cross-platform/node_modules/electron-builder/src/packager.ts:240:28
From previous event:
    at Packager.doBuild (/Users/joe/app-cross-platform/node_modules/electron-builder/out/packager.js:344:11)
    at /Users/joe/app-cross-platform/node_modules/electron-builder/src/packager.ts:186:52
    at next (native)
From previous event:
    at Packager.build (/Users/joe/app-cross-platform/node_modules/electron-builder/out/packager.js:263:11)
    at /Users/joe/app-cross-platform/node_modules/electron-builder/src/builder.ts:283:40
    at next (native)
From previous event:
    at build (/Users/joe/app-cross-platform/node_modules/electron-builder/out/builder.js:63:21)
    at then (/Users/joe/app-cross-platform/node_modules/electron-builder/src/cli/cli.ts:48:4)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)
From previous event:
    at Object.args [as handler] (/Users/joe/app-cross-platform/node_modules/electron-builder/src/cli/cli.ts:48:4)
    at Object.runCommand (/Users/joe/app-cross-platform/node_modules/yargs/lib/command.js:226:22)
    at Object.parseArgs [as _parseArgs] (/Users/joe/app-cross-platform/node_modules/yargs/yargs.js:998:24)
    at Object.get [as argv] (/Users/joe/app-cross-platform/node_modules/yargs/yargs.js:912:21)
    at Object.<anonymous> (/Users/joe/app-cross-platform/node_modules/electron-builder/src/cli/cli.ts:42:15)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:383:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:496:3

Building AppImage for arch x64
No native production dependencies
Packaging for win32 x64 using electron 1.6.15 to ../app - Distribution/win-unpacked
No native production dependencies
Packaging for win32 ia32 using electron 1.6.15 to ../app - Distribution/win-ia32-unpacked
Building nsis installer (x64 and ia32)
Downloading nsis-3.0.1.13, please wait
Error: Exit code: 4. Command failed: sips --resampleHeightWidth 64 64 /private/var/folders/g2/xvz16l791h11py_dsnw7nrj80000gn/T/temp-files-FPxVgW/1.iconset/icon_256x256.png --out /private/var/folders/g2/xvz16l791h11py_dsnw7nrj80000gn/T/temp-files-FPxVgW/1.iconset/icon_64x64.png
Warning: /private/var/folders/g2/xvz16l791h11py_dsnw7nrj80000gn/T/temp-files-FPxVgW/1.iconset/icon_256x256.png not a valid file - skipping
Error 4: no file was specified
Try 'sips --help' for help using this tool

Warning: /private/var/folders/g2/xvz16l791h11py_dsnw7nrj80000gn/T/temp-files-FPxVgW/1.iconset/icon_256x256.png not a valid file - skipping
Error 4: no file was specified
Try 'sips --help' for help using this tool

    at /Users/joe/app-cross-platform/node_modules/builder-util/src/util.ts:116:16
    at ChildProcess.exithandler (child_process.js:205:5)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:920:16)
    at Socket.<anonymous> (internal/child_process.js:351:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:497:12)
From previous event:
    at exec (/Users/joe/app-cross-platform/node_modules/builder-util/src/util.ts:84:3)
    at resizeImage (/Users/joe/app-cross-platform/node_modules/electron-builder/src/targets/LinuxTargetHelper.ts:260:12)
    at resize (/Users/joe/app-cross-platform/node_modules/electron-builder/src/targets/LinuxTargetHelper.ts:180:75)
    at /Users/joe/app-cross-platform/node_modules/electron-builder/src/targets/LinuxTargetHelper.ts:186:21
    at next (native)
    at go$readdir$cb (/Users/joe/app-cross-platform/node_modules/graceful-fs/graceful-fs.js:149:14)
From previous event:
    at LinuxTargetHelper.createFromIcns (/Users/joe/app-cross-platform/node_modules/electron-builder/out/targets/LinuxTargetHelper.js:236:11)
    at /Users/joe/app-cross-platform/node_modules/electron-builder/src/targets/LinuxTargetHelper.ts:58:25
    at next (native)
    at FSReqWrap.oncomplete (fs.js:123:15)
From previous event:
    at LinuxTargetHelper.computeDesktopIcons (/Users/joe/app-cross-platform/node_modules/electron-builder/out/targets/LinuxTargetHelper.js:88:11)
    at new LinuxTargetHelper (/Users/joe/app-cross-platform/node_modules/electron-builder/src/targets/LinuxTargetHelper.ts:23:23)
    at getHelper (/Users/joe/app-cross-platform/node_modules/electron-builder/src/linuxPackager.ts:33:18)
    at outDir (/Users/joe/app-cross-platform/node_modules/electron-builder/src/linuxPackager.ts:62:122)
    at mapper (/Users/joe/app-cross-platform/node_modules/electron-builder/src/targets/targetFactory.ts:49:16)
    at LinuxPackager.createTargets (/Users/joe/app-cross-platform/node_modules/electron-builder/src/linuxPackager.ts:62:7)
    at createTargets (/Users/joe/app-cross-platform/node_modules/electron-builder/src/targets/targetFactory.ts:56:12)
    at /Users/joe/app-cross-platform/node_modules/electron-builder/src/packager.ts:240:28
From previous event:
    at Packager.doBuild (/Users/joe/app-cross-platform/node_modules/electron-builder/out/packager.js:344:11)
    at /Users/joe/app-cross-platform/node_modules/electron-builder/src/packager.ts:186:52
    at next (native)
From previous event:
    at Packager.build (/Users/joe/app-cross-platform/node_modules/electron-builder/out/packager.js:263:11)
    at /Users/joe/app-cross-platform/node_modules/electron-builder/src/builder.ts:283:40
    at next (native)
From previous event:
    at build (/Users/joe/app-cross-platform/node_modules/electron-builder/out/builder.js:63:21)
    at then (/Users/joe/app-cross-platform/node_modules/electron-builder/src/cli/cli.ts:48:4)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)
From previous event:
    at Object.args [as handler] (/Users/joe/app-cross-platform/node_modules/electron-builder/src/cli/cli.ts:48:4)
    at Object.runCommand (/Users/joe/app-cross-platform/node_modules/yargs/lib/command.js:226:22)
    at Object.parseArgs [as _parseArgs] (/Users/joe/app-cross-platform/node_modules/yargs/yargs.js:998:24)
    at Object.get [as argv] (/Users/joe/app-cross-platform/node_modules/yargs/yargs.js:912:21)
    at Object.<anonymous> (/Users/joe/app-cross-platform/node_modules/electron-builder/src/cli/cli.ts:42:15)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:383:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:496:3

npm ERR! Darwin 17.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dist"
npm ERR! node v6.11.4
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] dist: `electron-builder -mwl`
npm ERR! Exit status 255
npm ERR! 
npm ERR! Failed at the [email protected] dist script 'electron-builder -mwl'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     electron-builder -mwl
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls app
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/joe/app-cross-platform/npm-debug.log

@alphadijkstra alphadijkstra changed the title Exit Code 4 sips errors builds failing. Exit Code 4 - sips error - builds failing. Oct 15, 2017
@alphadijkstra
Copy link
Author

alphadijkstra commented Oct 15, 2017

I fixed this sips issue by taking a look at this issue I found in the meantime:
#239
I only had to add all the icons to the folder build/icons. Which is kinda odd since the builder should generate them from the provided icon.icns.

But now I'm having a new issue...

Log:

Downloading nsis-3.0.1.13, please wait
Error: Exit code: null. Command failed: /Users/joe/Library/Caches/electron-builder/appimage/appimage-9.0.1/darwin/appimagetool --runtime-file /Users/joe/Library/Caches/electron-builder/appimage/appimage-9.0.1/runtime-x86_64 /Users/joe/app - Distribution/__appimage-x64 /Users/joe/app - Distribution/app-0.9.0-beta-x86_64.AppImage
dyld: Library not loaded: /usr/local/opt/glib/lib/libglib-2.0.0.dylib
  Referenced from: /Users/joe/Library/Caches/electron-builder/appimage/appimage-9.0.1/darwin/appimagetool
  Reason: image not found

dyld: Library not loaded: /usr/local/opt/glib/lib/libglib-2.0.0.dylib
  Referenced from: /Users/joe/Library/Caches/electron-builder/appimage/appimage-9.0.1/darwin/appimagetool
  Reason: image not found

    at /Users/joe/app-cross-platform/node_modules/builder-util/src/util.ts:116:16
    at ChildProcess.exithandler (child_process.js:205:5)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:920:16)
    at Socket.<anonymous> (internal/child_process.js:351:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:497:12)
From previous event:
    at exec (/Users/joe/app-cross-platform/node_modules/builder-util/src/util.ts:84:3)
    at /Users/joe/app-cross-platform/node_modules/electron-builder/src/targets/appImage.ts:106:5
    at next (native)
    at /Users/joe/app-cross-platform/node_modules/graceful-fs/graceful-fs.js:99:16
    at /Users/joe/app-cross-platform/node_modules/graceful-fs/graceful-fs.js:43:10
    at FSReqWrap.oncomplete (fs.js:123:15)
From previous event:
    at AppImageTarget.build (/Users/joe/app-cross-platform/node_modules/electron-builder/out/targets/appImage.js:193:11)
    at taskManager.addTask.default.map.it (/Users/joe/app-cross-platform/node_modules/electron-builder/src/platformPackager.ts:119:85)
From previous event:
    at LinuxPackager.packageInDistributableFormat (/Users/joe/app-cross-platform/node_modules/electron-builder/src/platformPackager.ts:119:41)
    at /Users/joe/app-cross-platform/node_modules/electron-builder/src/platformPackager.ts:115:10
From previous event:
    at LinuxPackager.pack (/Users/joe/app-cross-platform/node_modules/electron-builder/out/platformPackager.js:184:11)
    at /Users/joe/app-cross-platform/node_modules/electron-builder/src/packager.ts:260:24
From previous event:
    at Packager.doBuild (/Users/joe/app-cross-platform/node_modules/electron-builder/out/packager.js:344:11)
    at /Users/joe/app-cross-platform/node_modules/electron-builder/src/packager.ts:186:52
    at next (native)
From previous event:
    at Packager.build (/Users/joe/app-cross-platform/node_modules/electron-builder/out/packager.js:263:11)
    at /Users/joe/app-cross-platform/node_modules/electron-builder/src/builder.ts:283:40
    at next (native)
From previous event:
    at build (/Users/joe/app-cross-platform/node_modules/electron-builder/out/builder.js:63:21)
    at then (/Users/joe/app-cross-platform/node_modules/electron-builder/src/cli/cli.ts:48:4)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)
From previous event:
    at Object.args [as handler] (/Users/joe/app-cross-platform/node_modules/electron-builder/src/cli/cli.ts:48:4)
    at Object.runCommand (/Users/joe/app-cross-platform/node_modules/yargs/lib/command.js:226:22)
    at Object.parseArgs [as _parseArgs] (/Users/joe/app-cross-platform/node_modules/yargs/yargs.js:998:24)
    at Object.get [as argv] (/Users/joe/app-cross-platform/node_modules/yargs/yargs.js:912:21)
    at Object.<anonymous> (/Users/joe/app-cross-platform/node_modules/electron-builder/src/cli/cli.ts:42:15)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:383:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:496:3

npm ERR! Darwin 17.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dist"
npm ERR! node v6.11.4
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] dist: `electron-builder -mwl`
npm ERR! Exit status 255
npm ERR! 
npm ERR! Failed at the [email protected] dist script 'electron-builder -mwl'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     electron-builder -mwl
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls app
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/joe/app-cross-platform/npm-debug.log

@alphadijkstra
Copy link
Author

alphadijkstra commented Oct 15, 2017

My next issue was fixed by doing the following:
Installing Brew
Installing XCode (due to new dev machine and forgot to install it)
Install glib through the command brew install glib.

And that was all, that also took me a few hours to figure out. Hope someone else with the same issue reads this and gets it instantly fixed :)

@alphadijkstra alphadijkstra changed the title Exit Code 4 - sips error - builds failing. Exit Code 4 and 2 - sips error - builds failing - libglib-2.0.0.dylib missing Oct 15, 2017
@develar develar reopened this Oct 15, 2017
@develar
Copy link
Member

develar commented Oct 15, 2017

@teras is it possible to fix this issue and include glib to Appimagetool?

@teras
Copy link

teras commented Oct 15, 2017 via email

@develar
Copy link
Member

develar commented Oct 15, 2017

Thanks for quick response. Our goal is to allow users use clean OS and do not install extra deps. Ok, I will investigate how do we can static link it or bundle as part of tool.

develar added a commit to develar/electron-builder that referenced this issue Oct 27, 2017
@mengfoobar
Copy link

@alphadijkstra thanks for the info! Saved me lots of time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants