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.

Electron path in 1.3.5 doesn't exist

See original GitHub issue

With the latest update, I am getting this error. Electron is clearly installed, but bytenode is unable to find it. Line 49 in lib/index.js was changed recently which seemed to break it. Console logging electronPath returns just ‘cli.js’. Downgrading to 1.3.4 fixes the issue.

image

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

1reaction
regentcid434commented, Apr 14, 2022

I’m currently halfway through a sprint, and rolling back to the previous version works for now. Once I have a minute, I’ll try setting this up in a new project to see if I can replicate it. Thanks for the quick replies.

1reaction
OsamaAbbascommented, Apr 14, 2022

I guess the problem is because your electron is locally installed and you are trying to use the globally-installed bytenode.

With the latest change, (global) bytenode will look for the globally-installed electron, not the local one.

This is not the desired behavior in my opinion. Bytenode should always use the locally-installed electron first. I’m not sure if it should look for the global one at all. (This depends on how electron apps building tools work though).

So, as a proposed fix, we can tell the require.resolve function where to look:

const modulePaths = [process.cwd(), ...require.resolve.paths('electron')];
const electronPath = path.join(path.dirname(require.resolve('electron', { paths: modulePaths })), 'cli.js');

Another workaround is to use the locally-installed bytenode: $ ./node_modules/.bin/bytenode -c -e index.js.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Requiring electron outside of main.js causes a TypeError #7300
Electron version: 1.3.5 Operating system: Mint 17 Hello I am using ... Property 'api' does not exist on type 'Window & typeof globalThis'....
Read more >
Electron and Webpack ENOENT: no such file or directory ...
I suspect that it may have something to do with the start script in package.json as the path.txt is not in the same...
Read more >
aarontrionfi_thesis.pdf - Douglas Natelson
1/f spectrum should exist. However, the theory as it stands is not influenced by inter- ference of electron paths. In fact, this theory...
Read more >
Quantum Computation and Quantum Information
1 Introduction and overview. 1. 1.1 Global perspectives. 1. 1.1.1 History of quantum computation and quantum information. 2. 1.1.2 Future directions.
Read more >
Tecnai on-line help manual -- Modes - Dartmouth
1.3.5 ... electrons) from the beam, thereby giving contrast in the image. ... Reset the α tilt to 0° again and repeat until...
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