Carrying on from my previous Node.js adventure, I hit upon another error causing me several hours of pain. This was raised during a task carried out by grunt-contrib-imagemin whilst trying to minimize a PNG file:
Error in file: an/example/path/my-image.png
The system cannot find the path specified.
When I ran the same task with the –verbose flag it showed me that it was finding the images and reading them but was then erroring. Strange, if it can find the images why is it saying it can’t find the file?!
I spent a couple of hours checking path formats, searching through forums, reinstalling packages and in the end it was this thread that helped massively, explaining that the dependency that actually carries out the image manipulation may be missing its vendor folder. I checked and sure enough the node_modules/optipng-bin/vendor/ was missing.
I carried out a npm install opting-bin –savedev –force and the vendor folder was restored. Huzzah!