Skip to content Skip to sidebar Skip to footer

Unable To Find Electron App

I'm running through this youtube tutorial on an Ubuntu 17.10 and when I run the build command ng build --prod && electron . the result is: Error launching app Unable to fin

Solution 1:

First install electron as a dev dependency like you have done with npm i --save-dev electron. Then setup your build scripts like this:

"electron":"electron","electron-build":"ng build --prod && npm run electron"

The reason electron was not running is that it included a . in the electron run script like this `"electron": "electron .".

EDIT:

I believe it should be enough to do:

$ npm run electron

You don't have to edit your package.json. npm will try to find the electron in your node_modules/.bin then it will search in your global dependencies.

Try to avoid installing global npm dependencies. If you are installing a command line tool because your project needs it then always install it locally.

Solution 2:

If you are using @angular/cli ~1.4.0, make sure main.js and package.json are in same folder.

<root>/src
      index.htmlmain.tsmain.js
package.json

Post a Comment for "Unable To Find Electron App"