question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ENOENT: no such file or directory, open '.svgo.yml'

See original GitHub issue

Describe the bug I’m trying to use the popular https://github.com/svg/svgo but can’t due to the following error:

webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:1887 Error: ENOENT: no such file or directory, open '/node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/renderer/../../.svgo.yml'

It looks like an issue related to the https://github.com/svg/svgo/issues/622 and saw some workaround where yarn clean cause this. However, I can confirm that I don’t have any .yarnclean in my project, nor Yarn is cleaning anything at all as I manually verified the node_modules/svgo.yml and it exists over there.

In addition, I have also verified by creating a standard and fresh Electron project without using the electron builder and can confirm it works as expected. So, the issue most likely being somewhere in the electron builder.

To Reproduce

  1. Install yarn add svgo --dev
  2. Import svgo either on the background.js or in a single file Vue component.
  3. import svgo from svgo`
  4. To reproduce, simply just initialise the svgo object.
  5. console.log(new svgo)
  6. You should see the relevant error in the console.

Expected behavior I expect the SVGO library works by not showing an error and the SVGO library can find the .svgo.yml file from the node_modules.

Screenshots Screenshot 2020-02-03 at 12 09 52 AM

Environment (please complete the following information):

  • OS and version: macOS Catalina Version 10.15.3
  • node version: 13.7.0
  • npm version: 6.13.6
  • yarn version (if used): 1.21.1
  • vue-cli-plugin-electron-builder version : 2.0.0-beta.1
  • electron version: 7
  • other vue plugins used: N/A
  • custom config for vcp-electron-builder:
module.exports = {
  pluginOptions: {
    electronBuilder: {
      nodeIntegration: true
    }
  }
};
  • (if possible) link to your repo: N/A

Additional context Add any other context about the problem here. The SVGO file refers the .svgo.yml file https://github.com/svg/svgo/blob/master/lib/svgo/config.js#L30 and it seems fine.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
nklaymancommented, Feb 6, 2020

In your reproduction instructions, you installed svgo as a devDepenecency. It has to be install as a non-dev dependency. Run yarn remove svgo && yarn add svgo and then try again.

0reactions
mmikhancommented, Feb 7, 2020

Thanks man, that worked now. Never realised that adding the svgo as a devDependencies would be a such issue 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

ENOENT: no such file or directory, open '.svgo.yml' · Issue #1214
Having the ENOENT: no such file or directory, open '.svgo.yml' issue in an Electron app based on Vue CLI that is https://github.com/nklayman/vue ...
Read more >
Webpack bundling failed - no such file node_modules\svgo ...
New Update : i tried to add the bootstrap.min.css manually into the index html file , then also it wont work , got...
Read more >
svgo - npm
Nodejs-based tool for optimizing SVG vector graphics files. Latest version: 3.0.2, last published: a month ago. Start using svgo in your ...
Read more >
mxstbr/react-boilerplate - Gitter
... Error: ENOENT: no such file or directory, open '/Users/home/Projects/React/react-boilerplate/node_modules/svgo/lib/svgo/../../.svgo.yml' at Object.fs.
Read more >
起こったエラーメモ - now - nju33
(node:1) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '//../../.svgo.yml' at Object.fs.openSync (fs.js:646:18) at ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found