即使在使用乾淨的Yeoman斜角版本時,我仍然繼續獲得grunt build
:yo angular whatever
。Yeaoman Grunt imagemin致命錯誤:無法讀取屬性'內容'undefined
Warning: Running "imagemin:dist" (imagemin) task
Fatal error: Cannot read property 'contents' of undefined
即使在使用乾淨的Yeoman斜角版本時,我仍然繼續獲得grunt build
:yo angular whatever
。Yeaoman Grunt imagemin致命錯誤:無法讀取屬性'內容'undefined
Warning: Running "imagemin:dist" (imagemin) task
Fatal error: Cannot read property 'contents' of undefined
只是更新你的grunt-contrib-imagemin版本。
例:"grunt-contrib-imagemin": "^0.9.2"
到
"grunt-contrib-imagemin": "^1.0.0"
這對我的工作。
我不得不降級imagemin,現在所有的作品。
npm cache clean && npm install [email protected]
我Gruntfile.js改變了這一行:
src: '{,*/}*.{png,jpg,jpeg,gif}',
這一行:
src: '[*/*.{png,jpg,jpeg,gif,svg}]'
是啊。當時沒有第一版,我不認爲。 – Mika