The error happens when trying to convert icon.icns using the normal nativefier command. I think it could be an Electron issue. Please let me know if so.
Are you nativefying a public website?
Yes
Feature request? Have you looked at nativefier --help to see if an existing option could fit your needs?
Yes
Full nativefier command used to build your app: nativefier https://www.ranchhand.com
Version of Nativefier (run nativefier --version): Most Recent
Version of node.js (run node --version): v8.11.1
OS: <10.13.4>
Error message / stack trace (if any):
"You can’t open the application “Electron” because it may be damaged or incomplete."
<Error message / Stack trace here>
Extract Error
Downloading tmp-2410-1-SHASUMS256.txt-1.8.4
[============================================>] 100.0% of 3.43 kB (3.43 kB/s)
Packaging app for platform darwin x64 using electron v1.8.4
{ Error: ENOENT: no such file or directory, lstat '/var/folders/c9/2w45zsjs7413fpf2068rqthc0000gp/T/tmp-2410gKETAI9P4YDT/icon.icns'
errno: -2,
code: 'ENOENT',
syscall: 'lstat',
path: '/var/folders/c9/2w45zsjs7413fpf2068rqthc0000gp/T/tmp-2410gKETAI9P4YDT/icon.icns' }
@crimsoncrust does passing a --name "ranchhand" option work around your issue? See https://github.com/jiahaog/nativefier/issues/567 . Also, in which folder are you doing the building, and does passing the output directory help? (so, for example, nativefier --name "ranchhand" https://www.ranchhand.com /tmp/ranchhand)
Hello @ronjouch thanks for the quick reply! Sorry, it does not change anything, but the output folders name does change. I still get the following error:
"ENT: no such file or directory, lstat '/tmp/tmp-25253fHIwP0SFO3M/icon.icns'
errno: -2,
code: 'ENOENT',
syscall: 'lstat',
path: '/tmp/tmp-25253fHIwP0SFO3M/icon.icns' }"
@crimsoncrust can you then try passing explicitly a PNG icon as --icon ? Say you downloaded an icon (png format) as /Users/crimsoncrust/ranchhand.png, then try nativefier --name "ranchhand" --icon "/Users/crimsoncrust/ranchhand.png" https://www.ranchhand.com /tmp/ranchhand
Hello @ronjouch that worked!
Thanks!
@crimsoncrust thanks for confirming! I don't have a Mac for testing and got a few similar reports. Good to know where the issue is, and have a workaround. Cheers!
I experience this issue if I do not have imagemagick installed and the icon does not exist in the icon cache. The changes in #583 will make this issue less likely to occur, as natievefier will fallback on sips when imagemagick is not present, but this may still be useful if icon conversion can fail for other reasons.
This issue still occurs
14:23 $ nativefier --name "SOME_NAME" --icon ./MYICON.png "https://codepen.io/pixelass/debug/XXXXXXXXX"
packaging [============================== ] 61%Packaging app for platform darwin x64 using electron v1.8.4
packaging [================================= ] 65%{ Error: ENOENT: no such file or directory, lstat '/PATH/TO/MY/PROJECT/MYICON.icns'
errno: -2,
code: 'ENOENT',
syscall: 'lstat',
path: '/PATH/TO/MY/PROJECT/MYICON.icns' }
packaging [======================================== ] 80%âś” ~//PATH/TO/MY/PROJECT/
Re-opening. Recent changes thanks to @bacongravy might help with that (thanks!). @pixelass please try running the latest dev build, or wait for the next release 🙂.
I just provided a .icns file for now. thx.
Still occurs, latest build, 9.2.0, different error.
Converting icons...
Converting icon /tmp/nativefier-1-3-32-iconinfer--96915-u0qu0bpYzFli/icon.png to /tmp/nativefier-1-3-32-iconconv--96915-d1DoU3iity0c/icon.icns. Calling: "/usr/local/lib/node_modules/nativefier/icon-scripts/convertToIcns" "/tmp/nativefier-1-3-32-iconinfer--96915-u0qu0bpYzFli/icon.png" "/tmp/nativefier-1-3-32-iconconv--96915-d1DoU3iity0c/icon.icns"
Failed to convert icon to .icns, skipping. {
stdOut: '',
stdError: '/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.3y8GLAqV/converted.iconset:Failed to generate ICNS.\n'
}
I don't think yazeed's error is the same. Is your problem perhaps related to #321 ?
Most helpful comment
Hello @ronjouch that worked!
Thanks!