gruntjs / grunt-contrib-imagemin

Minify PNG, JPG, GIF and SVG images.
https://gruntjs.com
MIT License
1.21k stars 175 forks source link

Error: spawn … ENOENT when it's a sub-dependency #360

Closed ryuran closed 7 years ago

ryuran commented 8 years ago

Hello

I have a project with grunt-contrib-imagemin@1.0.0 as dependency. When I run grunt imagemin:build inside, everything is OK.

But when my project is a dependency of another one, the install task fail on it.

Running "imagemin:build" (imagemin) task
Warning: Error: spawn …/test2/node_modules/optipng-bin/vendor/optipng ENOENT in file src/img/xxx.png Use --force to continue.

I test it on 2 different environnement and node 4.4.4 Can be from optipng. Can be linked to #348 .

Thanks for help

ryuran commented 8 years ago

Seems to be from NPM https://github.com/npm/npm/issues/12644

blowsie commented 8 years ago

Referencing https://github.com/gruntjs/grunt-contrib-imagemin/issues/348 https://github.com/gruntjs/grunt-contrib-imagemin/issues/360 https://github.com/gruntjs/grunt-contrib-imagemin/issues/350

geoffdavis92 commented 7 years ago

@ryuran if you're still having this problem, try reinstalling all node modules a la this comment.

Worked for me

ryuran commented 7 years ago

Since this issue I stop to use grunt. @geoffdavis92

sindresorhus commented 7 years ago

Closing to clean up the issue tracker. If this is still an issue, open an issue on the relevant Imagemin plugin/binary repo instead.