JamieMason/grunt-imageoptim — pull request #11 by ahmedelgabri (2013-08-10 06:06:49+00:00)
Title: Fix path for imageOptim excutable

I got this error a couple of times `Fatal error: Unable to locate ImageOptim-CLI in "/Users/Gabri/Sites/dev/node_modules/grunt-imageoptim/node_modules/imageoptim-cli/bin"".
Please raise issue: https://github.com/JamieMason/grunt-imageoptim/issues/new.`

After looking around inside the `node_modules` folder for `imageoptim-cli` I found that there is no `node_modules` folder inside `imageoptim-cli` folder & that it's not inside the `grunt-imageoptim` folder too.

So inside I edited [this line](https://github.com/JamieMason/grunt-imageoptim/blob/master/tasks/imageoptim.js#L57) to make it `path.resolve('node_modules/imageoptim-cli/bin')` and it worked.

_Not really a Node expert, so I'm sure there might be a better way to do this_