Electron-vue: Error building with electron-builder: "Error: Exit code: ENOENT. spawn icns2png ENOENT"

Created on 19 Feb 2017  ·  7Comments  ·  Source: SimulatedGREG/electron-vue

Getting this error when running npm run build:

Packaging for linux x64 using electron 1.6.0 to dist/linux-unpacked
Unhandled rejection Error: Exit code: ENOENT. spawn icns2png ENOENT
Describe the issue / bug.

Unable to build with electron-builder. Here is the console output

This issue seems to indicate a problem with icns2png not being able to convert the macOS icns file to a png. But I'm not entirely sure. Perhaps we can specifically set a 32x32.png for the build?

How can I reproduce this problem?

Stock standard install:

vue init simulatedgreg/electron-vue my-project # select electron-builder for build tool
cd my-project
npm install
npm run build
Tell me about your development environment.
  • Node version: v7.5.0
  • NPM version: v4.1.2
  • vue-cli version: v2.8.1
  • Operating System: Ubuntu 16.04.1
enhancement

Most helpful comment

With electron-builder 19.19.1 and Ubuntu 17, I solved it by running:
sudo apt install icnsutils
and
sudo apt install graphicsmagick

All 7 comments

@nicklaw5

I think you would be right about there being issues trying to convert the icns to a png. Luckily, it seems that electron-builder now supports an option for a linux specific image icon now. I'll be pushing out an update to support this soon. Hopefully this new feature solves your problem.
https://github.com/electron-userland/electron-builder/wiki/Options#LinuxBuildOptions

@SimulatedGREG Any progress on getting the Linux image option added? I'm hoping to start work on a new project over the weekend.

@SimulatedGREG @nicklaw5 it turns out to me that to make a build in my machine I would have to install and configure a LOT of things. So after a long research I ended up finding a "solution" using electron-builder docker image that is already configured with all you need to build in linux and windows. I tried to build in MacOs without success...

docker run --rm --name electron -ti -d -v ${PWD}:/project -v ${PWD##*/}-node-modules:/project/node_modules electronuserland/electron-builder:wine
docker exec electron npm install && npm prune
docker exec electron npm run build:linux
docker exec electron npm run build:windows
docker stop electron

If you don't need build to Windows you can use electron-builder:latest instead.

build:linux >> npm run pack && build --linux --x64
build:windows >> npm run pack && build --windows --x64

https://github.com/electron-userland/electron-builder/wiki/Docker

EDIT

@nicklaw5 here you can find all the configuration needed to ubuntu to compile to Linux/Windows/Mac.

https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build

Something important to note is that .dmg and .pkg need to be signed and can be compiled only in Mac machine.

This has been fixed in the dev branch and will be released in the next milestone; #171 for more info. Closing.

With electron-builder 19.19.1 and Ubuntu 17, I solved it by running:
sudo apt install icnsutils
and
sudo apt install graphicsmagick

@NPellet it has been solved in my Ubuntu 16 with latest electron-builder

Was this page helpful?
0 / 5 - 0 ratings