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.

[5.x] weird error when running "electron-forge start" without node_modules

See original GitHub issue
  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Please describe your issue: I’m getting this error when I run electron-forge start:

An unhandled error has occurred inside Forge:
Expected a string version for electron version, got a "object"
Error: Expected a string version for electron version, got a "object"
``
But the error is incorrect.

<!-- For bugs and questions, please answer these questions to the best of your ability. -->

**Console output when you run `electron-forge` with the environment variable `DEBUG=electron-forge:*`. (Instructions on how to do so [here](https://www.npmjs.com/package/debug#usage)). Please include the stack trace if one exists.**

WARNING: DEBUG environment variable detected. Progress indicators will be sent over electron-forge:lifecycle electron-forge:lifecycle Process Started: Checking your system +0ms electron-forge:lifecycle Process Succeeded: Checking your system +184ms electron-forge:runtime-config setting key: verbose to value: false +0ms WARNING: DEBUG environment variable detected. Progress indicators will be sent over electron-forge:lifecycle electron-forge:lifecycle Process Started: Locating Application +0ms electron-forge:project-resolver searching for project in: /home/spaceboyross/paradise-client +0ms electron-forge:project-resolver electron-forge compatible package.json found in /home/spaceboyross/paradise-client/package.json +19ms electron-forge:lifecycle Process Succeeded: Locating Application +20ms electron-forge:util Could not read package.json for moduleName=electron-prebuilt-compile { [Error: ENOENT: no such file or directory, open ‘/home/spaceboyross/paradise-client/node_modules/electron-prebuilt-compile/package.json’] errno: -2, code: ‘ENOENT’, syscall: ‘open’, path: ‘/home/spaceboyross/paradise-client/node_modules/electron-prebuilt-compile/package.json’ } +0ms electron-forge:util Could not read package.json for moduleName=electron { [Error: ENOENT: no such file or directory, open ‘/home/spaceboyross/paradise-client/node_modules/electron/package.json’] errno: -2, code: ‘ENOENT’, syscall: ‘open’, path: ‘/home/spaceboyross/paradise-client/node_modules/electron/package.json’ } +4ms electron-forge:util Could not read package.json for moduleName=electron-prebuilt { [Error: ENOENT: no such file or directory, open ‘/home/spaceboyross/paradise-client/node_modules/electron-prebuilt/package.json’] errno: -2, code: ‘ENOENT’, syscall: ‘open’, path: ‘/home/spaceboyross/paradise-client/node_modules/electron-prebuilt/package.json’ } +0ms electron-forge:util getElectronVersion failed to determine Electron version: projectDir=/home/spaceboyross/paradise-client, result=null +0ms electron-forge:lifecycle Process Started: Preparing native dependencies +11ms electron-forge:lifecycle Process Failed: Preparing native dependencies +2ms

An unhandled error has occurred inside Forge: Expected a string version for electron version, got a “object” Error: Expected a string version for electron version, got a “object” at new Rebuilder (/home/spaceboyross/.nvm/versions/node/v11.0.0/lib/node_modules/electron-forge/node_modules/electron-rebuild/lib/src/rebuild.js:62:19) at rebuildWithOptions (/home/spaceboyross/.nvm/versions/node/v11.0.0/lib/node_modules/electron-forge/node_modules/electron-rebuild/lib/src/rebuild.js:316:23) at doRebuild (/home/spaceboyross/.nvm/versions/node/v11.0.0/lib/node_modules/electron-forge/node_modules/electron-rebuild/lib/src/rebuild.js:323:16) at /home/spaceboyross/.nvm/versions/node/v11.0.0/lib/node_modules/electron-forge/dist/util/rebuild.js:27:57 at Generator.next (<anonymous>) at Generator.tryCatcher (/home/spaceboyross/.nvm/versions/node/v11.0.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/util.js:16:23) at PromiseSpawn._promiseFulfilled (/home/spaceboyross/.nvm/versions/node/v11.0.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/generators.js:97:49) at /home/spaceboyross/.nvm/versions/node/v11.0.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/generators.js:201:15 at /home/spaceboyross/.nvm/versions/node/v11.0.0/lib/node_modules/electron-forge/dist/util/rebuild.js:53:22 at _promise2.default (/home/spaceboyross/.nvm/versions/node/v11.0.0/lib/node_modules/electron-forge/dist/util/ora-handler.js:46:5) at new Promise (<anonymous>) at new F (/home/spaceboyross/.nvm/versions/node/v11.0.0/lib/node_modules/electron-forge/node_modules/core-js/library/modules/_export.js:36:28) at asyncOra (/home/spaceboyross/.nvm/versions/node/v11.0.0/lib/node_modules/electron-forge/dist/util/ora-handler.js:45:10) at /home/spaceboyross/.nvm/versions/node/v11.0.0/lib/node_modules/electron-forge/dist/util/rebuild.js:25:36 at Generator.next (<anonymous>) at Generator.tryCatcher (/home/spaceboyross/.nvm/versions/node/v11.0.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/util.js:16:23)


**What command line arguments are you passing?**


**What does your `config.forge` data in `package.json` look like?**

“forge”: { “make_targets”: { “win32”: [ “squirrel” ], “darwin”: [ “zip” ], “linux”: [ “deb”, “rpm” ] }, “electronPackagerConfig”: { “packageManager”: “npm” }, “electronWinstallerConfig”: { “name”: “Paradise” }, “electronInstallerDebian”: {}, “electronInstallerRedhat”: {}, “github_repository”: { “owner”: “”, “name”: “” }, “windowsStoreConfig”: { “packageName”: “Paradise”, “name”: “paradise-client” } }


**Please provide either a failing minimal testcase (with a link to the code) or detailed steps to
reproduce your problem. Using `electron-forge init` is a good starting point, if that is not the
source of your problem.**

Run `electron-forge start`

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
maleptcommented, Dec 27, 2018

OK, I know why this error happens. This is the error you get if you don’t run npm install (or yarn, if you use yarn) before running electron-forge start.

What you really should do instead of running the globally installed electron-forge is run npm start, since electron-forge is listed in devDependencies. The globally installed Forge should only be used for init, import, and install subcommands, unless you have a really good reason.

0reactions
maleptcommented, Dec 9, 2018

@Tapestes well, one problem is that you have different versions of Electron specified. Remove electron from dependencies and update electron-prebuilt-compile to 3.0.10.

… actually, I think that might be the problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[5.x] weird error when running "electron-forge start" without ...
Please describe your issue: I'm getting this error when I run electron-forge start : An unhandled error has occurred inside Forge: Expected ...
Read more >
Error: Failed with exit code: 1 when try to "npm run make"
If you just want to package as a runnable exe not bundled into an installer, do npm run package . Share. Share a...
Read more >
Native Node Modules | Electron
When in doubt, run electron-rebuild first. Make sure the native module is compatible with the target platform and architecture for your Electron app....
Read more >
[webpack-cli] error: spawn unknown system error -86 - You.com
Today i got my new M1 Pro as well and I had the same issue. The interesting thing is that the npm run...
Read more >
Electron app with Webpack, Bootstrap, FontAwesome and ...
A step-by-step tutorial to build from scratch an electron app together with Bootstrap, FontAwesome, JQuery and bundled with Webpack!
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