Yeaoman Grunt imagemin Fatal error: cannot read the contents of the undefined property

I keep getting grunt build when I run it even with a clean Yeoman angular build: yo angular whatever .

Warning: completing the "imagemin: dist" (imagemin) job

Fatal error: cannot read the contents of the "content" undefined

+5
source share
3 answers

just upgrade your version with grunt-contrib-imagemin.

Example: "grunt-contrib-imagemin": "^0.9.2"

to

"grunt-contrib-imagemin": "^1.0.0"

he works for me.

+14
source

I had to lower my imagination, and now everything works.

 npm cache clean && npm install grunt-contrib-imagemin@0.9.1 
+8
source

I changed this line in Gruntfile.js:

 src: '{,*/}*.{png,jpg,jpeg,gif}', 

to this line:

 src: '[*/*.{png,jpg,jpeg,gif,svg}]' 
+3
source

Source: https://habr.com/ru/post/1240432/


All Articles