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.

spawn dist/electron.exe ENOENT

See original GitHub issue

win10 + 64 node.js 5.1.1 + 32

  "dependencies": {
    "ffi": "^2.0.0"
  },
  "devDependencies": {
    "electron-prebuilt": "^0.36.0",
    "electron-rebuild": "^1.0.2"
  }
  • exec
.\node_modules\.bin\electron-rebuild.cmd
  • error info
spawn dist/electron.exe ENOENT
Error: spawn dist/electron.exe ENOENT
    at exports._errnoException (util.js:856:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at doNTCallback2 (node.js:452:9)
    at process._tickCallback (node.js:366:17)

node_modules\electron-prebuilt\dist\electron.exe is exist

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
rspiekercommented, Dec 16, 2015

I had a similar problem on OSX (same error, different executable of course). OSX 10.10.5 / OSX 10.11.1 Node.js 5.0.0 / 5.1.0

Worked around it by changing node_modules/electron-rebuild/lib/spawn.js

Around line 25, there is this code:

  return new _Promise(function (resolve, reject) {
    var error = null;
    //console.log("Calling spawn! " + JSON.stringify(options));
    var proc = _child_process2['default'].spawn(options.cmd, options.args, options.opts);

Changed it to provide the cwd (current working directory) to the spawn command

  return new _Promise(function (resolve, reject) {
    var error = null;
    if (!('cwd' in options.opts)) {
        options.opts.cwd = process.cwd() + '/node_modules/electron-prebuilt';
    }
    //console.log("Calling spawn! " + JSON.stringify(options));
    var proc = _child_process2['default'].spawn(options.cmd, options.args, options.opts);

I’m sure this isn’t the way to go (as the paths on various OS’s will differ), hence I haven’t made a pull request.

0reactions
felicienfrancoiscommented, Feb 4, 2016

@tomprogers

But electron-prebuilt throws a fatal error at startup unless I use the original path

Why don’t you use the original path ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

spawn dist/electron.exe ENOENT · Issue #39
I had a similar problem on OSX (same error, different executable of course). OSX 10.10.5 / OSX 10.11.1. Node.js 5.0.0 / 5.1.0. Worked ......
Read more >
Developers - spawn dist/electron.exe ENOENT -
Coming soon: A brand new website interface for an even better experience!
Read more >
Uncaught Error: spawn .\node.exe ENOENT
When i run the app using npm start it works fine, and no error is run. Its when the app is run as...
Read more >
A Comprehensive Guide to Building and Packaging an ...
Building and Packaging an Electron App wasn't as straight forward as I had hoped. This guide aims to help you navigate the complexities...
Read more >
Building a Windows build on a MacOS - Error: spawn yarn ...
I'm on a 2015 MacBook Pro and for the life of me, I cannot see why I cannot make an .exe build (Windows)...
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