I've been attempting to solve this for over half the day now.
I have an angularjs project that I use grunt to build.
Running my grunt
command give me the following:
``` Running "concurrent:dist" (concurrent) task
Running "svgmin:dist" (svgmin) task
Total saved: 0 B
Done, without errors.
Execution Time (2014-09-23 21:53:55 UTC)
loading tasks 7ms ▇▇▇▇▇▇ 11%
svgmin:dist 58ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 89%
Total 65ms
Warning: Running "imagemin:dist" (imagemin) task
Fatal error: Object #<DestroyableTransform> has no method 'apply'
Execution Time (2014-09-23 21:53:55 UTC)
imagemin:dist 868ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 99%
Total 876ms Use --force to continue.
Aborted due to warnings.
```
Here's my imagemin task in my GruntFile.js:
imagemin: {
dist: {
files: [
{
expand: true,
cwd: '<%= yeoman.app %>/images',
src: '{,*/}*.{png,jpg,jpeg,gif}',
dest: '<%= yeoman.dist %>/images'
}
]
}
}
I can't find anything on the interwebs that helps me. I did find this open issue, but no one has responded as of yet: https://github.com/gruntjs/grunt-contrib-imagemin/issues/254
Thanks.
In short, I am using Fedora
and my problem was solved by:
(sudo) yum install optipng
Here is the long answer.
This problem was not obvious because the error message does not tell much. It actually means one or more of the four dependencies was(were) missing:
gifsicle — Compress GIF images
jpegtran — Compress JPEG images
optipng — Compress PNG images
svgo — Compress SVG images
And those binaries are OS dependent.
The problem solving process is:
npm install grunt-contrib-imagemin
Apparently, png compression requires the libpng-dev
library and I needed to install that on my build server using:
sudo apt-get install libpng-dev
I also updated my package.json to use the latest grunt-contrib-imagemin ("^0.8.0")
Running npm install
and grunt
now work w/o errors.
imagemin error through using grunt serve:dist
-mode.
Try the following instead.
npm uninstall
rm -rf node_modules
npm cache clean
npm install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With