I am trying to press images with grunt-contrib-imagemin ~0.9.4
in a node.js
application. My config is:
imagemin: {
dynamic: {
files: [{
expand: true,
cwd: 'server/static/img/',
src: ['**/*.{jpg,gif,png}'],
dest: '_public/incl/img/'
}]
}
},
I systematically get a Error: spawn ENOENT in file somepath/someimage.png
message. It fails at the first processed .png
file. When I don't include .png
files, it all works fine.
I have read somewhere that I should copy the image files first in the target directory as a workaround. I have tried this, but it does not solve the issue.
I am on Windows 7 32-bits and I am using grunt ~0.4.5
. How can I solve this issue?
I am trying to press images with grunt-contrib-imagemin ~0.9.4
in a node.js
application. My config is:
imagemin: {
dynamic: {
files: [{
expand: true,
cwd: 'server/static/img/',
src: ['**/*.{jpg,gif,png}'],
dest: '_public/incl/img/'
}]
}
},
I systematically get a Error: spawn ENOENT in file somepath/someimage.png
message. It fails at the first processed .png
file. When I don't include .png
files, it all works fine.
I have read somewhere that I should copy the image files first in the target directory as a workaround. I have tried this, but it does not solve the issue.
I am on Windows 7 32-bits and I am using grunt ~0.4.5
. How can I solve this issue?
-
1
Did you try to disable the cache with
options: { cache: false }
? – Reto Aebersold Commented Jul 1, 2015 at 20:27 - I just did, but it did not solve the issue. – Jérôme Verstrynge Commented Jul 1, 2015 at 20:38
5 Answers
Reset to default 7Blow away node_modules/grunt-contrib-imagemin and try and do a npm install
again. The node equivalent of “did you restart it”?
I see in their github repo they have a couple of issues related to pngs, but nothing like you are seeing.
just reinstall the image-webpack-loader. That's worked for me.
This rebuild
fixed my problem.
Laravel Mix Issues Optimising Images in Sass Files | Andy Carter
$ npm rebuild mozjpeg $ npm rebuild gifsicle $ npm rebuild optipng-bin
Seems to be caused by a recent change in a package that imagemin is dependent on. The new setup doesn't support proxies until someone fixes it. https://github./kevva/download/issues/64
This thread suggests downgrading bin-build from 2.1.2 to 2.1.1
Just delete the node_modules folder and then run npm install
or npm i
to install all the modules again