ben-eb / gulp-svgmin

Minify SVG files with gulp.
MIT License
340 stars 34 forks source link

ENOENT: no such file or directory, open 'project/node_modules/svgo/lib/svgo/../../.svgo.yml' #73

Closed jonniespratley closed 7 years ago

jonniespratley commented 7 years ago

Here is the output:

[09:53:13] Using gulpfile ~/Github/vault-dashboard/gulpfile.js
[09:53:13] Starting 'images'...
Unhandled rejection Error: ENOENT: no such file or directory, open '/Users/212400520/Github/vault-dashboard/node_modules/svgo/lib/svgo/../../.svgo.yml'
    at Object.fs.openSync (fs.js:558:18)
    at Object.fs.readFileSync (fs.js:468:33)
    at module.exports (/Users/212400520/Github/vault-dashboard/node_modules/svgo/lib/svgo/config.js:31:48)
    at new module.exports (/Users/212400520/Github/vault-dashboard/node_modules/svgo/lib/svgo.js:21:19)
    at buf (/Users/212400520/Github/vault-dashboard/node_modules/imagemin-svgo/index.js:16:15)
    at /Users/212400520/Github/vault-dashboard/node_modules/promise.pipe/index.js:25:18
    at process._tickCallback (internal/process/next_tick.js:103:7)

Any thoughts on why this is happening?

rpoitras commented 7 years ago

I had the same error with an angular cli project that I'm using yarn for dependency management. The problem for me was caused by running a yarn clean. This issue 662 on svgo suggested deleting the .yarnclean file. Fixed my problem. Maybe you've had something similar with a gulp clean command.

smarterdigitalltd commented 7 years ago

@rpoitras this worked for me with this exact issue - thanks!

ben-eb commented 7 years ago

@rpoitras Nice work, thanks for suggesting that fix. 👍