-
Notifications
You must be signed in to change notification settings - Fork 175
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
Error: spawn ENOENT when running imagemin task #96
Comments
Same for me, when I do a grunt build, I get this:
|
It looks like it's backing out of it's own directory and into an adjacent one or something. This also only seems to happen with PNGs. |
I was updating my NPMs today and noticed a popup from Microsoft Security Essentials giving the following notice, stating it's quarantining a file (optipng.exe) it believes to be a virus, which is probably why this problem has been occurring. Apparently this has been happening for the last couple of weeks, so I've left the file quarantined until further notice. Any thoughts on this? |
Duplicate of imagemin/optipng-bin#12 |
I've removed the quarantined "optipng.exe" file, disabled the virus program, removed all node_modules and reinstalled, and am still getting the same error. I even disabled all imagemin options and this is what it's telling me when running 'grunt imagemin --vebose'
|
I'm getting this error on OS X. It looks like imagemin looks for the pngquant binary in node_modules/pngquant-bin/vendor/pngquant. Unfortunately, as of version 0.1.4 of pngquant-bin, that binary is in a different location. I believe that the solution is to update package.json to reference a specific version of pngquant-bin instead of any 0.1 version. I tried 0.1.3 and it worked for me. |
Everything in my build process works flawlessly and I only ever have problems with grunt-contrib-imagemin, so my conclusion is that this is pretty much worthless on Windows machines. I still get the spawn error, so bleh... I'm done. |
This still chokes on JPEGs using jpegtran-bin 0.2.3 and grunt-contrib-imagemin 0.5.0. Tested on Win 8.1 Pro 64 bit. It's a tad frustrating |
Same issues here. Also Win 8.1 64bit. |
+1 on Win 8.1 64bit |
+1, it fails on Win 8.1 x64 |
So what now? I'm on Win 8.1 64 bit and I am having this problem. Any workarounds or alternatives? Or just no image optimization for me anymore? :-/ |
@Guuz tried falling back to ~0.4? |
@vladikoff no, I will give that a try! |
@vladikoff I was on 0.4.0 and it didn’t work, which is why I tried upgrading to 0.5.0. No dice ☹ |
@vladikoff : Strange... We were actually on v0.3.0. I have just upgraded to v0.5.0 and this works for us on Win 7, Win 8.1 and mac. v0.4.0 also worked. |
Hi, I guess switching versions could make it work... |
Has this problem being fixed? I still have it: with version 0.3.0 it's present in one directory and NOT present in another, so it's a package dependency breaking everything... If I copy imagemin package from an older project (always 0.3.0 version), this works fine. I'm trying to find out what's causing it. |
I can say the cause is pngquant-bin module. I couldn't track it down to a submodule because after specifying a version, it's auto-fixed: {
"pngquant-bin": "0.1.6",
"gifsicle": "0.1.4",
"jpegtran-bin": "0.2.3",
"optipng-bin": "0.3.1",
"pngquant-bin": "0.1.6",
"grunt-contrib-imagemin": "0.3.0"
} This in my package.json fixed the issue Important note: specify those in your package.json, CLEAN node_modules directory (completely, even .bin directory), restart your computer, I think it's an issue with environment or a link to an exe that doesn't exist, I don't know, but I didn't want to track it down so restarting was ok (one time). After restart, run My full package.json if anyone interested: https://gist.github.com/Fire-Dragon-DoL/407c4823af0d7811cfa9 |
I fixed it by following @Fire-Dragon-DoL's advice directly above. Then I followed this comment's instructions. Finally, I did |
i've been struggling with imagemin in general from so long on so many issues i might go back to some simpler GUI like prepros or something |
@vlrprbttst, that isn't very helpful. Could you describe what problems you are experiencing? |
my latest problem is this: http://prntscr.com/4dcsqk |
Ultimately, the problem is that you cannot simply run Also, at least in my experience you can't simply run |
The watch task isn't related to imagemin, it's just how that one works. The spawn issue is caused by some binary not existing. Try installing a newer version of imagemin (^1.0.0). I have no problems whatsoever on Windows. Most of the issues are with Linux. |
This is latest Mac Yosemite, date is March 2015. Installed imagemin as well as pngquant latest version. Not working, failing with error message provided by the thread creator. |
Installing earlier version of contrib-imagemin fixed it for me. I picked one at random. used 0.4.0, grunt build worked |
@SamJacobs Worked for me. I was using 0.8.0 and it started working when I installed 0.7.0 |
Okay, I found out when this is happening: when the prebuild-test failed and thus is compiling from the source, see extract below:
This happened during instable network conditions which is not the real issue here. The problem is that compiling from source results in a different state than when doing the pre-build. Both ways should make the code behave the same. |
I'm having a similar issue with jpegtran failing to build, likely due to Github's network problems... The real underlying issue seems to be that optipng and jpegtran's build scripts can fail "silently," without cascading upwards to imagemin/grunt-imagemin. |
I've opened a PR in |
@schmod, that's exactly what we want. They are optional dependencies. Be aware of any error messages when installing instead. |
I left a comment in the other thread. Essentially, I don't think that's actually a desirable behavior, as it bypasses npm's built-in infrastructure for handling optional dependencies, and effectively makes
|
Ran into this issue with "grunt-contrib-imagemin": "^0.8.1". Updated to "grunt-contrib-imagemin": "^0.9.4" fixed my issue. |
Updating "grunt-contrib-imagemin" from "^0.9.2" to "^0.9.4" fixed my issue. |
I'm getting the following error when running imagemin. I'm not sure why, but it looks like it's adding a tmp folder inside the 'grunt-jekyll' task? I've tried running it independent of any other task and the same error occurs. After crashing, it leaves some of the images in the output folder with '.tmp' extensions (ex: image.png.tmp). Any ideas would be greatly appreciated, thanks!
The text was updated successfully, but these errors were encountered: