VS seems to install (and then use) an old version of node, which is why the task runner is breaking the build.
Go to Tools > Options > Projects and Solutions > External Web Tools
and add the correct path to your node version (find the path with which node
).
Credits to: https://github.com/sindresorhus/gulp-imagemin/issues/178#issuecomment-218131138