Gulp Error: spawn EACCES resulting from images added to asset folder

I get the following error every time I run Gulp with any images included in the assets/images directory. If I remove all images there is no error. Any ideas how I might resolve this issue?

child_process.js:1155
    throw errnoException(err, 'spawn');
          ^
Error: spawn EACCES
    at exports._errnoException (util.js:746:11)
    at ChildProcess.spawn (child_process.js:1155:11)
    at exports.spawn (child_process.js:988:9)
    at exports.execFile (child_process.js:682:15)
    at ExecBuffer.<anonymous> (/Users/me/Sites/Clients/client/2016/www.project-v1.dev/wp-content/themes/project/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/exec-buffer/index.js:91:3)
    at /Users/me/Sites/Clients/client/2016/www.project-v1.dev/wp-content/themes/project/node_modules/wiredep/node_modules/bower-config/node_modules/graceful-fs/graceful-fs.js:104:5
    at FSReqWrap.oncomplete (fs.js:99:15)

All permissions are set correctly: 755 / 644

I followed this thread but it didn’t resolve the issue.

System: OS X 10.10.3 / Roots Sage v8.2.0

Did you try Google with your error? I found this: https://github.com/sindresorhus/gulp-imagemin/issues/55

Generally if you get an error like that you may have a bad node_modules folder, and so would need to delete and npm install again. Or an outdated version of node/npm, which versions do you have?

npm -v
2.7.4

Does re-running npm install overwrite anything else?
Any idea what may have caused a bad node_modules directory, and can it be avoided?

EDIT: I upgraded to npm 2.11 but the issue persists.

Thx

No, npm install will only touch node_modules

Did you delete the node_modules folder before running npm install again?

No!

I’ve re-run nmp-install after deleting the node_modules folder and it’s working as expected.

Thanks for your help.
Much appreciated.

This topic is now unlisted. It will no longer be displayed in any topic lists. The only way to access this topic is via direct link.