Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENOENT: no such file or directory, open '(...)/node_modules/svgo/lib/svgo/../../.svgo.yml' #693

Closed
binarykitchen opened this issue Mar 29, 2017 · 5 comments

Comments

@binarykitchen
Copy link

When having installed your package with yarn and using it in gulp over postcss I am seeing this error. But when installed with npm, this does not happen.

Not sure whether it's a bug in your module or whether it's a yarn bug.

~/c/videomail-client ❯❯❯ gulp                                                                 release/1.24.1 ✭ ✖ ✱
[21:30:40] Options: { _: [],
  minify: false,
  importance: null,
  write: false,
  version: null }
[21:30:40] Using gulpfile ~/code/videomail-client/Gulpfile.js
[21:30:40] Starting 'stylus'...
[21:30:40] Finished 'stylus' after 476 ms
[21:30:40] Starting 'clean:js'...
[21:30:40] Starting 'todo'...
[21:30:40] Finished 'todo' after 29 ms
[21:30:40] Finished 'clean:js' after 45 ms
[21:30:40] Starting 'browserify'...
fs.js:583
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open '/home/michael-heuberger/code/videomail-client/node_modules/svgo/lib/svgo/../../.svgo.yml'
    at Object.fs.openSync (fs.js:583:18)
    at Object.fs.readFileSync (fs.js:490:33)
    at module.exports (/home/michael-heuberger/code/videomail-client/node_modules/svgo/lib/svgo/config.js:31:48)
    at new module.exports (/home/michael-heuberger/code/videomail-client/node_modules/svgo/lib/svgo.js:21:19)
    at /home/michael-heuberger/code/videomail-client/node_modules/postcss-svgo/dist/index.js:95:16
    at Object.creator [as postcssSvgo] (/home/michael-heuberger/code/videomail-client/node_modules/postcss/lib/postcss.js:150:35)
    at /home/michael-heuberger/code/videomail-client/node_modules/cssnano/dist/index.js:295:40
    at Array.forEach (native)
    at /home/michael-heuberger/code/videomail-client/node_modules/cssnano/dist/index.js:282:29
    at creator (/home/michael-heuberger/code/videomail-client/node_modules/postcss/lib/postcss.js:150:35)
@mmieluch
Copy link

mmieluch commented Apr 4, 2017

Hi @binarykitchen, I had the same issue and, as it turns out, yarn was cleaning that file out. I didn't install the package directly, but one of my dependencies vue-svgicon relied on svgo. Here's how I got rid of the problem:

  1. Removed two lines from my .yarnclean in the project root:
.*.yml
*.yml
  1. yarn remove vue-svgicon
  2. yarn add vue-svgicon

I believe if you did the above, but with svgo instead of vue-svgicon, you'd have the problem fixed. Good luck!

@binarykitchen
Copy link
Author

hmm, but why am i not seeing the .yarnclean file in your repo? an

... and are you expecting everyone doing these steps when using yarn instead of npm?

@mmieluch
Copy link

mmieluch commented Apr 5, 2017

First of all - it's not my repo. I'm just a user trying to help out a fellow dev ;)

Second of all - .yarnclean is set per project. So it's not set by the package. That's why I mentioned project root, not package root.

You may find this helpful: https://yarnpkg.com/lang/en/docs/cli/clean/

This problem has nothing to do with the svgo package - it's your local yarn config that's causing this.

@binarykitchen
Copy link
Author

aaaaah, gotcha, i see now. thanks for the link and explaining :)

@rishabhmhjn
Copy link

Refer:
#622 (comment)
#622 (comment)

lukemorse added a commit to lukemorse/Website that referenced this issue Nov 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants