[SOLVED] (electron) Error when running app and blank output from `electron` in command line


#1

I’ve been trying to delve into Electron but so far any attempt to fork a starting application fails.

  • Windows 10
  • Node 4.4.4
  • NPM 2.15.1
  • Ran from within CMDER

I’ve tried googling and can’t seem to find the issue that I’m having. I’ve reinstalled Node to the latest version, cleared previous global installations of electron-prebuilt, cleared the npm cache and tried a fresh to no avail :frowning:

I’m given a basic error response from the command line

W:\Node\electron-quick-start (master) (electron-quick-start@1.0.0)
λ npm install && npm start
|
> electron-prebuilt@1.1.0 postinstall W:\Node\electron-quick-start\node_modules\electron-prebuilt
> node install.js

electron-prebuilt@1.1.0 node_modules\electron-prebuilt
├── extract-zip@1.5.0 (debug@0.7.4, yauzl@2.4.1, mkdirp@0.5.0, concat-stream@1.5.0)
└── electron-download@2.1.2 (path-exists@1.0.0, home-path@1.0.3, minimist@1.2.0, debug@2.2.0, rc@1.1.6, mkdirp 0.5.1, mv@2.1.1, nugget@1.6.2)

> electron-quick-start@1.0.0 start W:\Node\electron-quick-start
> electron main.js


npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cl .js" "start"
npm ERR! node v4.4.4
npm ERR! npm  v2.15.1
npm ERR! code ELIFECYCLE
npm ERR! electron-quick-start@1.0.0 start: `electron main.js`
npm ERR! Exit status 3221225781
npm ERR!
npm ERR! Failed at the electron-quick-start@1.0.0 start script 'electron main.js'.
npm ERR! This is most likely a problem with the electron-quick-start package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     electron main.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs electron-quick-start
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls electron-quick-start
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     W:\Node\electron-quick-start\npm-debug.log

Followed by the contents of npm-debug.log;

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start' ]
2 info using npm@2.15.1
3 info using node@v4.4.4
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart electron-quick-start@1.0.0
6 info start electron-quick-start@1.0.0
7 verbose unsafe-perm in lifecycle true
8 info electron-quick-start@1.0.0 Failed to exec start script
9 verbose stack Error: electron-quick-start@1.0.0 start: `electron main.js`
9 verbose stack Exit status 3221225781
9 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:217:16)
9 verbose stack     at emitTwo (events.js:87:13)
9 verbose stack     at EventEmitter.emit (events.js:172:7)
9 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
9 verbose stack     at emitTwo (events.js:87:13)
9 verbose stack     at ChildProcess.emit (events.js:172:7)
9 verbose stack     at maybeClose (internal/child_process.js:827:16)
9 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid electron-quick-start@1.0.0
11 verbose cwd W:\Node\electron-quick-start
12 error Windows_NT 10.0.10240
13 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
14 error node v4.4.4
15 error npm  v2.15.1
16 error code ELIFECYCLE
17 error electron-quick-start@1.0.0 start: `electron main.js`
17 error Exit status 3221225781
18 error Failed at the electron-quick-start@1.0.0 start script 'electron main.js'.
18 error This is most likely a problem with the electron-quick-start package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error     electron main.js
18 error You can get information on how to open an issue for this project with:
18 error     npm bugs electron-quick-start
18 error Or if that isn't available, you can get their info via:
18 error
18 error     npm owner ls electron-quick-start
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]

Any attempt to run electron/electron -v directly gives me no response.

W:\Node\electron-quick-start (master) (electron-quick-start@1.0.0)
λ electron -v

W:\Node\electron-quick-start (master) (electron-quick-start@1.0.0)
λ electron

Hopefully someone will be able to help as I’m eager to have a mess about with things :slight_smile:

Thanks!


#2

I’m exactly in the same situation!

I have a working setup in another Windows 10 computer, with the same nodejs version and npm version. But now when I try to set up the environment on freshly installed Win 10 the npm start fails.


#3

I’m having this situation on Windows 7 64-Bit here.

I tried to update my NPM and NodeJS to their latest version, I can run the npm install but I can’t run the npm start, showing this problem.

$ npm start
> electron-quick-start@1.0.0 start D:\scotch\electron-quick-start
> electron main.js

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ICE\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.1.0
npm ERR! npm  v3.9.0
npm ERR! code ELIFECYCLE
npm ERR! electron-quick-start@1.0.0 start: `electron main.js`
npm ERR! Exit status 3221225781
npm ERR!
npm ERR! Failed at the electron-quick-start@1.0.0 start script 'electron main.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electron-quick-start package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     electron main.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs electron-quick-start
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls electron-quick-start
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\scotch\electron-quick-start\npm-debug.log

Yeah I would like the developers to look into this issue. It is getting really frustrating.


#4

SOLVED!
At least in my case the reason was the fresh installation of Windows 10. The C++ libraries are not there by default and I didn’t have any development tools installed.

Installing Visual C++ Redistributable for VS 2015 solved the problem.

You can get it from here: https://www.microsoft.com/en-us/download/details.aspx?id=48145


#5

Perfect - that fixed my issue :smiley:

Cheers!!


#6

Can you put [SOLVED] in front of the title :slight_smile:


#7

Is this just a development-time dependency, or do you also need these C++ libraries installed when distributing an Electron application built with electron-packager?

If it’s the latter, then there should really be a GitHub ticket created for the documentation to be updated at the very least. I had no idea that any dependencies might need to be installed when distributing an Electron app to a Windows machine.


#8

It’s a build dependency. Electron apps (especially for Windows) should be released as binaries, in which case they won’t need the libraries.


#9

Same error here,
Windows Server 2012 Standard

The only difference is that: my error doesn’t show at the initail npm start until my app run for a while. The error mostly shows up at early morning. I’ve run 3 same program, but not all of them will die.

I’m sure that I’ve installed the VC Redistributable for VS 2015 as mentioned by @nirkki

And I’ve tried to pack my app to a binary file to install. Still, it will fail after a while.

I’ve googled all the web. No proper solution for me.

Apparently it is a windows specific issue. Any advice?

Thanks !