Error when initialising electron App using electron-forge with electron-compile and electron-squirrel-startup
Asked Answered
H

3

5

I started learning on the electron by using the GitHub on demand training. When I executed the below command. The system throws the error.

electron % electron-forge init electron-app
⚠ Could not check Yarn version "0.32
", assuming incompatible
⚠ You are using Yarn, but not a known good version.
The known versions that work with Electron Forge are: 0.23.3 || 0.24.6 || >= 1.0.0 || 0.27.5
✔ Checking your system
? WARNING: The specified path: "/home/anoobbava/electron/electron-app" is not empty, do you wish to continue? Yes
✔ Initializing Project Directory
✔ Initializing Git Repository
✔ Copying Starter Files
✔ Initializing NPM Module
✖ Installing NPM Dependencies

An unhandled error has occurred inside Forge:
Failed to install modules: ["electron-compile","electron-squirrel-startup"]

With output: Exited with status 1
Error: Failed to install modules: ["electron-compile","electron-squirrel-startup"]

With output: Exited with status 1
    at /home/anoobbava/.nvm/versions/node/v9.9.0/lib/node_modules/electron-forge/dist/util/install-dependencies.js:55:13
    at Generator.throw (<anonymous>)
    at Generator.tryCatcher (/home/anoobbava/.nvm/versions/node/v9.9.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/util.js:16:23)
    at PromiseSpawn._promiseRejected (/home/anoobbava/.nvm/versions/node/v9.9.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/generators.js:107:10)
    at Promise._settlePromise (/home/anoobbava/.nvm/versions/node/v9.9.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/promise.js:576:26)
    at Promise._settlePromise0 (/home/anoobbava/.nvm/versions/node/v9.9.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/home/anoobbava/.nvm/versions/node/v9.9.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/promise.js:690:18)
    at _drainQueueStep (/home/anoobbava/.nvm/versions/node/v9.9.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/async.js:138:12)
    at _drainQueue (/home/anoobbava/.nvm/versions/node/v9.9.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/async.js:131:9)
    at Async._drainQueues (/home/anoobbava/.nvm/versions/node/v9.9.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/async.js:147:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/anoobbava/.nvm/versions/node/v9.9.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:763:18)
    at tryOnImmediate (timers.js:734:5)
    at processImmediate (timers.js:716:5)

Other details are below, OS: Ubuntu 18.04 node: v9.9.0 NPM: 6.4.1 I have updated my NPM version, but still, the issue persists. Also, Do I need to install yarn in this case.

Hypodermic answered 25/10, 2018 at 5:29 Comment(0)
S
5

I had a similar issue and it ended up being related to yarn version. I fixed it by installing yarn this way:

sudo npm install --global yarn 
Shetrit answered 16/2, 2019 at 9:55 Comment(0)
C
4

In my own case I had an electron program running in the background. Hence, I had to kill all electron program background processes.

Crackbrain answered 17/5, 2022 at 8:48 Comment(0)
C
0

Kill all electron program background processes.

Cool answered 9/2, 2023 at 5:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.