electron-userland / electron-prebuilt Goto Github PK
View Code? Open in Web Editor NEWπ Retired project. See README
Home Page: http://npm.im/electron
License: MIT License
π Retired project. See README
Home Page: http://npm.im/electron
License: MIT License
we need a command to run that:
npm version patch
does)the command should be e.g. 'node update.js 0.26.0'
then they can use it here electron/electron#1488 to automate
On OSX (Yosemite), After npm install -g atom-shell
, i typed atom-shell .
and it told me...
The file '/usr/local/bin/atom-shell' is marked as an executable but could not be run by the operating system.
The file created looked like this...
"/usr/local/lib/node_modules/atom-shell/dist/Atom.app/Contents/MacOS/Atom" "$@"
So i just changed it to
#!/usr/bin/env bash
"/usr/local/lib/node_modules/atom-shell/dist/Atom.app/Contents/MacOS/Atom" "$@"
And it worked fine. Maybe this is because im running fish
as my default shell?
The version that install.js
pulls down is hard coded
to 0.18.0
, but the latest release is 0.19.5
which has lots of bug fixes. Maybe we could figure out what the latest version is and have it pull that?
I'm trying to run electron on a 32-bit windows 7 without any dependencies and it throws the following
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows\system32>npm install -g electron-prebuilt
C:\Users\Virtual\AppData\Roaming\npm\electron -> C:\Users\Virtual\AppData\Roamin
g\npm\node_modules\electron-prebuilt\cli.js
> [email protected] postinstall C:\Users\Virtual\AppData\Roaming\npm\node
_modules\electron-prebuilt
> node install.js
Downloading electron-v0.32.3-win32-ia32.zip
[============================================>] 100.0% of 39.71 MB (3.53 MB/s)
[email protected] C:\Users\Virtual\AppData\Roaming\npm\node_modules\elect
ron-prebuilt
βββ [email protected] ([email protected], [email protected], [email protected], [email protected], conc
[email protected])
βββ [email protected] ([email protected], [email protected], [email protected],
[email protected], [email protected], [email protected], [email protected])
C:\Windows\system32>electron
module.js:338
throw err;
^
Error: Cannot find module 'C:\Users\Virtual\AppData\Roaming\npm\node_modules\ele
ctron-prebuilt\dist\resources\atom.asar\browser\lib\init.js'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Function.Module.runMain (module.js:471:10)
at startup (node.js:139:18)
at node.js:991:3
C:\Windows\system32>node --version
v4.0.0
its a complete fresh install and using node v4 as you can see above
This was originally posted here: electron/electron-quick-start#6
After checking out this repository and running: npm install, I'm getting the following error message:
Error: self signed certificate in certificate chain
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/Cellar/node/4.2.1/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.2.1
npm ERR! npm v3.3.9
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node install.js'.
npm ERR! This is most likely a problem with the electron-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls electron-prebuilt
npm ERR! There is likely additional logging output above.
I am running behind a corporate firewall that does MITM HTTP/HTTPS content filtering, which does inject its own certificate. However, I don't normally get this error when installing NPM packages, as I have the self-signed certificate marked as trusted on my machine, and I've also set the "cafile=/path/to/cert" and "strict-ssl=false" set in my ~/.npmrc file.
It's on the github release page though.
β‘ Electron
is fun to play with, especially with the recent growth of apps. Between experimenting and modifying apps, electron-prebuilt
started downloading lots of πΎ on my machine. But I only want one copy, so I forked the lib and named it electron-bin. I felt like the changes might break other apps and don't address any major bugs, so I didn't submit a PR:
Difs:
Downloads electron in home directory - ~/.electron/<version>/.../electron
- checks for it's existence before starting any downloads, and rimrafs
the .zip
after download. Also added electronVersion
field in the package.json
for convenience.
PR potential?
If ~/.electron/
is treated as a cache, with the files copied into the local node_modules/electron-prebuilt/dest
folder, the behavior might be similar enough to not break anything. Let me know if there's PR interest because these libs are almost identical!!
Ref: s-a/iron-node#41
Can you point me to a OS list supported by electron?
how should "scripts" in package.json for spawning a node script be made cross platform?
if i have "scripts": {"install": "./index.js"} it errors on windows
if i have "scripts": {"install": "node index.js"} it will fail if the user doesnt have node
(e.g. some people have node as other names)
there is $NODE set to the node bin path but i dont know how to call that in a cross platform way
> [email protected] install /Users/bret/Documents/projects/friends/node_modules/electron-prebuilt
> node install.js
module.js:338
throw err;
^
Error: Cannot find module 'boom'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Users/bret/Documents/projects/friends/node_modules/request/node_modules/hawk/lib/index.js:3:33)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
I'll try to narrow this down in a bit.
Version 0.30.0 works fine with ES6 syntax, such as () => { console.log('Yay') }
.
Version 0.30.7 throw errors on such syntax.
Reinstalling electon-prebuilt because npm wouldn't update it and the reinstall came with this nifty error:
Cannot find module 'process-nextick-args'
It seems like it is not installing any of it's own modules. It also isn't installing the latest version on another computer, only version 0.25.3.
It would be great if this bundle could remove the zip file after the installation is done.
Hi,
I have the problem when installing the electron-prebuilt.
My platform is
Darwin 14.5.0, OS X 10.10.05
node v4.1.0
npm v2.14.4
The error log:
> node install.js
module.js:338
throw err;
^
Error: Cannot find module 'generate-object-property'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Users/john/Schoolwork/vcpe/vcpe-desktop/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/index.js:1:76)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/Cellar/node/4.1.0/bin/node" "/usr/local/bin/npm" "install" "electron-prebuilt" "--save-dev"
npm ERR! node v4.1.0
npm ERR! npm v2.14.4
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node install.js'.
npm ERR! This is most likely a problem with the electron-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls electron-prebuilt
npm ERR! There is likely additional logging output above.
Hi! I d like to pass custom command line arguments to have them available at process.argv
. Is there a way to submit values?
When I download the current version (0.30.4), it's not executable by default. Trying to run the app just says that it could not be run. All of the executables (so Electron.app/Contents/MacOS/electron
, Electron.app/Contents/Frameworks/Electron\ Framework.framework\Electron Framework
and such are marked non executable. chmod +x fixes this. They are executable when downloaded using grunt-download-electron. Is this an issue here? or upstream with electron?
[ '0.24.0', '0.25.0', '0.25.1-1', '0.25.1' ]
v1.0.0
...v1.2.1
The ia32 windows build seems to work fine on x64 systems but not vice versa. I would prefer to only distribute one windows version (32 bit) of my app, but still build it on a x64 system. Is there any way to install the ia32 version on x64 windows (besides from copying the folder from another system)?
And is this recommended at all? Should I rather just distribute separate ia32 and x64 windows versions of my app?
I have been trying to install electron on my Ubuntu system both as a dependancy and globally but both commands fail.
Here is the output:
saq1610@saq1610-MacBookPro:~/Watson$ sudo npm install electron-prebuilt -g
/usr/local/bin/electron -> /usr/local/lib/node_modules/electron-prebuilt/cli.js
> [email protected] postinstall /usr/local/lib/node_modules/electron-prebuilt
> node install.js
sh: 1: node: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! [email protected] postinstall: `node install.js`
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the electron-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls electron-prebuilt
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.2.0-19-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "electron-prebuilt" "-g"
npm ERR! cwd /home/saq1610/Watson
npm ERR! node -v v4.2.2
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/saq1610/Watson/npm-debug.log
npm ERR! not ok code 0
saq1610@saq1610-MacBookPro:~/Watson$
According to the log in /usr/share/doc/nodejs/README.Debian
this seems to be the issue:
nodejs command
--------------
The upstream name for the Node.js interpreter command is "node".
In Debian the interpreter command has been changed to "nodejs".
This was done to prevent a namespace collision: other commands use
the same name in their upstreams, such as ax25-node from the "node"
package.
Scripts calling Node.js as a shell command must be changed to instead
use the "nodejs" command.
It seems that electron still calls upon "node" rather than "nodejs" which is why the "install.js" script fails.
just a suggestion, how about we match the version in package.json with the version number that atom-shell releases with?
unfortunately http://npmjs.org/electron is taken.
ideas that are available:
anyone have better ideas? I like the bin
to match the name
, but having a long name sucks. so maybe npm i electron-cli -g
should install electron
?
We've been burned by this a couple of times but to install globally you have to do sudo npm install electron-prebuilt -g
and it seems like it's attempting to copy a temp file from a root folder into a user folder that it doesn't have access to.
The work around is to install electron-prebuilt locally once, npm install electron-prebuilt
to get the binary into the user folder cache, then install globally.
I just wanted to point this out, it would be nice if this error didn't happen, it's not blocking me though.
Hi,
I noticed that you have released 0.32.2 of electron-prebuilt but npmjs.com still lists 0.32.1 as the latest version.
$ npm install -g electron-prebuilt
C:\Users\Adrien\AppData\Roaming\npm\electron -> C:\Users\Adrien\AppData\Roaming\
npm\node_modules\electron-prebuilt\cli.js
> [email protected] postinstall C:\Users\Adrien\AppData\Roaming\npm\node_
modules\electron-prebuilt
> node install.js
events.js:85
throw er; // Unhandled 'error' event
^
Error: unexpected EOF
at C:\Users\Adrien\AppData\Roaming\npm\node_modules\electron-prebuilt\node_m
odules\extract-zip\node_modules\yauzl\index.js:341:45
at C:\Users\Adrien\AppData\Roaming\npm\node_modules\electron-prebuilt\node_m
odules\extract-zip\node_modules\yauzl\node_modules\fd-slicer\index.js:32:7
at FSReqWrap.wrapper [as oncomplete] (fs.js:527:17)
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "electron-prebuilt"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node install
.js'.
npm ERR! This is most likely a problem with the electron-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls electron-prebuilt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! d:\github\elec\npm-debug.log
I just had a hiccup in my internet while installing electron-prebuilt 0.30.4 and ended up with a 9.5 MB download of the zip for it instead of the 45.4 MB version. The install failed of course, and upon repeat attempts to install, it always got the same error and never attempted to re-download the zip.
Deleting the cached version from my user/.electron folder ended up making it download again and install correctly.
Perhaps a file size check of md5 verification on the cache after detecting that the file exists would be helpful.
Here is the error for reference:
Downloading electron-v0.30.4-win32-x64.zip
Error: GET https://github.com/atom/electron/releases/download/v0.30.4/electron-v0.30.4-win32-x64.zip returned 503
When I tried this all I got was the app running.. it didn't create anything anywhere for me to then distribute... should it create something? And if so where and how do I do this?
In the past I have just downloaded the latest release of atom-shell/electron and then just moved my /app folder into the resources folder for the .exe / .app and then renamed it and distributed.
Does this package offer any of that??
I think electron-prebuilt needs to include a dependency on module is-property because on my system it's bombing out and can't install because that module is missing. After I manually installed is-property electron-prebuilt installed correctly.
C:\Users\Frank\Desktop>npm install -g electron-prebuilt
C:\Users\Frank\AppData\Roaming\npm\electron -> C:\Users\Frank\AppData\Roaming\np
m\node_modules\electron-prebuilt\cli.js
> [email protected] postinstall C:\Users\Frank\AppData\Roaming\npm\node_m
odules\electron-prebuilt
> node install.js
module.js:334
throw err;
^
Error: Cannot find module 'is-property'
at Function.Module._resolveFilename (module.js:332:15)
at Function.Module._load (module.js:282:25)
at Module.require (module.js:361:17)
at require (module.js:380:17)
at Object.<anonymous> (C:\Users\Frank\AppData\Roaming\npm\node_modules\elect
ron-prebuilt\node_modules\electron-download\node_modules\nugget\node_modules\req
uest\node_modules\har-validator\node_modules\is-my-json-valid\node_modules\gener
ate-object-property\index.js:1:80)
at Module._compile (module.js:426:26)
at Object.Module._extensions..js (module.js:444:10)
at Module.load (module.js:351:32)
at Function.Module._load (module.js:306:12)
at Module.require (module.js:361:17)
at require (module.js:380:17)
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\iojs\\node.exe" "C:\\Program Files\\iojs\\node
_modules\\npm\\bin\\npm-cli.js" "install" "-g" "electron-prebuilt"
npm ERR! node v2.2.1
npm ERR! npm v2.11.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node install
.js'.
npm ERR! This is most likely a problem with the electron-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls electron-prebuilt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Frank\Desktop\npm-debug.log
v0.27.2 is missing from https://github.com/mafintosh/electron-prebuilt/releases
At the time of writing, npm should list v0.35.1 as latest version. However, on https://www.npmjs.com/package/electron-prebuilt, it lists 0.34.4 as latest release.
For some reason, npm i -D electron-prebuilt
works just dandy, it installs v0.35.1 and saved the proper tag in my package.json.
But running npm info electron-prebuilt
returns nothing at all. This causes problems for other modules like npm-check-updates...
This happens because it attempts to extract a zip file that has only been partially downloaded. We should support download resume or clear the cache if the install was interrupted. I believe the second would be more in line with user expectations.
Either way, I believe it should be more transparent about the fact that we it's creating a cache directory in ~/.electron
. Even though I suspected my problem involved caching, I had to dig into the code to find out where this cache was.
> [email protected] install /Users/federicobond/code/forks/electron-prebuilt
> node install.js
/Users/federicobond/code/forks/electron-prebuilt/install.js:18
throw err
^
Error: end of central directory record signature not found
at /Users/federicobond/code/forks/electron-prebuilt/node_modules/extract-zip/node_modules/yauzl/index.js:98:14
at /Users/federicobond/code/forks/electron-prebuilt/node_modules/extract-zip/node_modules/yauzl/index.js:342:5
at /Users/federicobond/code/forks/electron-prebuilt/node_modules/extract-zip/node_modules/yauzl/node_modules/fd-slicer/index.js:32:7
at FSReqWrap.wrapper [as oncomplete] (fs.js:527:17)
That's the end of the install log:
npm info install [email protected]
npm info postinstall [email protected]
> [email protected] postinstall /Users/ferrylauda/.nvm/versions/node/v0.12.4/lib/node_modules/electron-prebuilt
> node install.js
read err { [Error: invalid block type] errno: -3, code: 'Z_DATA_ERROR' }
[email protected] /Users/ferrylauda/.nvm/versions/node/v0.12.4/lib/node_modules/electron-prebuilt
βββ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
βββ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
npm info ok
Notice that the install ended successfully in spite of the error.
Running electron
from command line fails with:
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn /Users/ferrylauda/.nvm/versions/node/v0.12.4/lib/node_modules/electron-prebuilt/dist/Electron.app/Contents/MacOS/Electron ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
at child_process.js:1144:20
at process._tickCallback (node.js:355:11)
at Function.Module.runMain (module.js:503:11)
at startup (node.js:129:16)
at node.js:814:3
Here are the vesions I'm using:
$ npm version
{ npm: '2.10.1',
http_parser: '2.3',
modules: '14',
node: '0.12.4',
openssl: '1.0.1m',
uv: '1.5.0',
v8: '3.28.71.19',
zlib: '1.2.8' }
right now atom-shell ./hello-app
doesn't work, but /Users/maxogden/src/js/dat-shell/node_modules/atom-shell/dist/Atom.app/Contents/MacOS/Atom ./hello-app
does
https://github.com/dougnukem/hello-atom/tree/master/hello-app
This issue is moved from electron/electron#2319
Ran npm install electron-prebuilt -g
as suggested by readme.
Main log:
C:\Users\bas\AppData\Roaming\npm\electron -> C:\Users\bas\AppData\Roaming\npm\node_modules\electron-prebuilt\cli.js
> [email protected] postinstall C:\Users\bas\AppData\Roaming\npm\node_modules\electron-prebuilt
> node install.js
module.js:334
throw err;
^
Error: Cannot find module 'is-property'
at Function.Module._resolveFilename (module.js:332:15)
at Function.Module._load (module.js:282:25)
at Module.require (module.js:361:17)
at require (module.js:380:17)
at Object.<anonymous> (C:\Users\bas\AppData\Roaming\npm\node_modules\electron-prebuilt\node_modules\electron-download\node_modules\nugget\node_modules\request\node_modules\har-validator\node_modul
es\is-my-json-valid\node_modules\generate-object-property\index.js:1:80)
at Module._compile (module.js:426:26)
at Object.Module._extensions..js (module.js:444:10)
at Module.load (module.js:351:32)
at Function.Module._load (module.js:306:12)
at Module.require (module.js:361:17)
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files (x86)\\iojs\\node.exe" "C:\\Program Files (x86)\\iojs\\node_modules\\npm\\bin\\npm-cli.js" "install" "electron-prebuilt" "-g"
npm ERR! node v2.3.0
npm ERR! npm v2.11.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node install.js'.
npm ERR! This is most likely a problem with the electron-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls electron-prebuilt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\bas\npm-debug.log
Versions:
C:\Users\bas>npm -v
2.11.1
C:\Users\bas>node -v
v2.3.0
The complete debug : https://gist.github.com/basarat/a913c77a711dedce111b
This probably isn't really an issue with this project but npm on windows 8.1. But I think I have a better chance of resolving this with somebody who hasn't got 800 issues on there hands. I hope you don't mind, otherwise feel free to close this issue straight away.
On windows 8.1 in the folder ~\AppData\Roaming\npm there lie all the .cmd
scripts to launch global executable npm packages including atom-shell.
This is the content for the atom-shell .cmd
file:
@IF EXIST "%~dp0\/bin/bash.exe" (
"%~dp0\/bin/bash.exe" "%~dp0\node_modules\atom-shell\run.bat" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
/bin/bash "%~dp0\node_modules\atom-shell\run.bat" %*
)
Windows will arrive at the last line in this script:
/bin/bash "%~dp0\node_modules\atom-shell\run.bat" %*
and then fail, because there is no such thing as /bin/bash on windows?!?!?!
Just upgraded to electron v0.33.0 but the download is failing on linux x64. You can find an error log here.
When I start electron with "$ electron" it does nothing.
When I start electron on my project with "$ electron ."
it says:
0615/102324:ERROR:http_transport_mac.mm(186)] Could not connect to the server. (NSURLErrorDomain -1004)
I'm on Mac OSX 10.8.5 and I installed electron with command line "$ npm install electron-prebuilt -g"
electron version: v0.27.2
npm version: 2.11.0
iosj version: v2.2.1
Also if I install latest electron version, same error ("$ npm install [email protected] -g")
Also Electron.app does work if I download it from https://github.com/atom/electron/releases/tag/v0.28.1
@maxogden
Is this a correct path(of us)?:cat2:
https://github.com/mafintosh/electron-prebuilt/blob/master/run.bat#L2
(this is a re-take on #44)
Steps to reproduce the issue at hand:
git clone https://github.com/loveencounterflow/electron-sample-1.git
cd electron-sample-1
npm install
npm start
, or, equivalently, node_modules/.bin/electron .
If you're running this on e.g. Linux, you should be seeing the app window (with minimal HTML and devtools opened). However, on my OSX 10.8.4, this consistently crashes (dumps available).
The weird thing is i can make the app run as expected by downloading and unpacking https://github.com/atom/electron/releases/download/v0.30.4/electron-v0.30.4-darwin-x64.zip, and then executing ~/Downloads/electron-v0.30.4-darwin-x64.zip\ Folder/Electron.app/Contents/MacOS/Electron .
, which appears to strongly suggest that the fault lies specifically with electron-prebuilt
on OSX.
I would be grateful if anyone could reproduce the issue; it is not impossible that there's an issue with my OS somehow (although the assumption is that the manually downloaded and the prebuilt version of Electron should behave identically).
i'm trying to do the basic first steps as outlined in "Creating Desktop Apps with Electron" by Kyle Robinson Young but i only get to the point where executing electron .
should bring up an empty window. My index.js
looks like this:
var app = require( 'app' );
var BrowserWindow = require( 'browser-window' );
var log = console.log;
log( app );
log( process[ 'versions' ] );
app.on( 'ready', function(){
log( "app ready" );
var main_window = new BrowserWindow({
width: 1200,
height: 800,
});
var url = 'file://' + __dirname + '/index.html';
main_window.loadUrl( url );
} );
app.on( 'gpu-process-crashed', function(){ log( 'gpu-process-crashed' ); } );
app.on( 'select-certificate', function(){ log( 'select-certificate' ); } );
app.on( 'activate-with-no-open-windows', function(){ log( 'activate-with-no-open-windows' ); } );
app.on( 'before-quit', function(){ log( 'before-quit' ); } );
app.on( 'browser-window-blur', function(){ log( 'browser-window-blur' ); } );
app.on( 'browser-window-focus', function(){ log( 'browser-window-focus' ); } );
app.on( 'open-file', function(){ log( 'open-file' ); } );
app.on( 'open-url', function(){ log( 'open-url' ); } );
app.on( 'quit', function(){ log( 'quit' ); } );
app.on( 'ready', function(){ log( 'ready' ); } );
app.on( 'will-finish-launching', function(){ log( 'will-finish-launching' ); } );
app.on( 'will-quit', function(){ log( 'will-quit' ); } );
app.on( 'window-all-closed', function(){ log( 'window-all-closed' ); } );
i get to see the output from the two console.log
calls, but neither the ready
event handler nor any of the other event handlers gets called; instead, the process terminates.
Edit i'm using n
for keeping multiple versions of NodeJS/iojs and have set the global iojs version to 2.3.1
. Turns out when i start the bundled executable directly from the command line as .../test-electron/node_modules/electron-prebuilt/dist/Electron.app/Contents/MacOS/Electron
, the process exits with Segmentation fault: 11
. Any ideas what could be going wrong here? BTW this is on OSX 10.8.4.
Edit 2 this is getting a little weirder now: i downloaded the prebuilt binary zip from https://github.com/atom/electron/releases and overwrote the Electron.app
that came with npm install
with the one from the downloaded archiveβand it works. Comparing the contents of the two (with DiffMerge) would appear to show that the only difference is that the version installed via npm install
lacks a lot of language files like ...electron-v0.29.2-darwin-x64.zip Folder/Electron.app/Contents/Resources/en.lproj/
and so on.
Using Electron v0.33.7 and the electron
executable the --enabled-logging
option is not working. However if you use cli.js
directly then --enable-logging
works.
It keeps connecting but never connects. It happens on OSX and Linux. I can`t test on Windows.
With this error message Unsupported target version: 0.30.7
.
Here is the full stack track
> [email protected] rebuild /Users/khanguyen/CodeProjects/Outsource/grabluck
> electron-rebuild
> [email protected] install /Users/khanguyen/CodeProjects/Outsource/grabluck/node_modules/babel/node_modules/chokidar/node_modules/fsevents
> node-pre-gyp install --fallback-to-build
Unsupported target version: 0.30.7
node-pre-gyp ERR! install error
node-pre-gyp ERR! stack Error: Unsupported target version: 0.30.7
node-pre-gyp ERR! stack at get_runtime_abi (/Users/khanguyen/CodeProjects/Outsource/grabluck/node_modules/babel/node_modules/chokidar/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/versioning.js:140:23)
node-pre-gyp ERR! stack at Object.module.exports.evaluate (/Users/khanguyen/CodeProjects/Outsource/grabluck/node_modules/babel/node_modules/chokidar/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/versioning.js:249:19)
node-pre-gyp ERR! stack at install (/Users/khanguyen/CodeProjects/Outsource/grabluck/node_modules/babel/node_modules/chokidar/node_modules/fsevents/node_modules/node-pre-gyp/lib/install.js:138:31)
node-pre-gyp ERR! stack at Object.self.commands.(anonymous function) [as install] (/Users/khanguyen/CodeProjects/Outsource/grabluck/node_modules/babel/node_modules/chokidar/node_modules/fsevents/node_modules/node-pre-gyp/lib/node-pre-gyp.js:48:37)
node-pre-gyp ERR! stack at run (/Users/khanguyen/CodeProjects/Outsource/grabluck/node_modules/babel/node_modules/chokidar/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp:79:30)
node-pre-gyp ERR! stack at Object.<anonymous> (/Users/khanguyen/CodeProjects/Outsource/grabluck/node_modules/babel/node_modules/chokidar/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp:131:1)
node-pre-gyp ERR! stack at Module._compile (module.js:434:26)
node-pre-gyp ERR! stack at Object.Module._extensions..js (module.js:452:10)
node-pre-gyp ERR! stack at Module.load (module.js:355:32)
node-pre-gyp ERR! stack at Function.Module._load (module.js:310:12)
node-pre-gyp ERR! System Darwin 14.5.0
node-pre-gyp ERR! command "/Users/khanguyen/.nvm/versions/node/v4.1.0/bin/node" "/Users/khanguyen/CodeProjects/Outsource/grabluck/node_modules/babel/node_modules/chokidar/node_modules/fsevents/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/khanguyen/CodeProjects/Outsource/grabluck/node_modules/babel/node_modules/chokidar/node_modules/fsevents
node-pre-gyp ERR! node -v v4.1.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.9
node-pre-gyp ERR! not ok
npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/khanguyen/.nvm/versions/node/v4.1.0/bin/node" "/Users/khanguyen/CodeProjects/Outsource/grabluck/node_modules/electron-rebuild/node_modules/npm/bin/npm-cli.js" "rebuild" "--target=0.30.7" "--arch=x64"
npm ERR! node v4.1.0
npm ERR! npm v2.14.5
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! This is most likely a problem with the fsevents package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR! npm owner ls fsevents
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/khanguyen/CodeProjects/Outsource/grabluck/node_modules/npm-debug.log
Process exited with code: 1
Error: Process exited with code: 1
at ChildProcess.<anonymous> (/Users/khanguyen/CodeProjects/Outsource/grabluck/node_modules/electron-rebuild/lib/spawn.js:55:26)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:817:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:469:12)
npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/khanguyen/.nvm/versions/node/v4.1.0/bin/node" "/Users/khanguyen/.nvm/versions/node/v4.1.0/bin/npm" "run" "rebuild"
npm ERR! node v4.1.0
npm ERR! npm v2.14.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] rebuild: `electron-rebuild`
npm ERR! Exit status 255
npm ERR!
npm ERR! Failed at the [email protected] rebuild script 'electron-rebuild'.
npm ERR! This is most likely a problem with the grabluck package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! electron-rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls grabluck
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/khanguyen/CodeProjects/Outsource/grabluck/npm-debug.log
I have tried installing electron-prebuilt using npm however I run into errors similar to this other user (electron/electron#1578).
$ sudo npm install electron-prebuilt -g
fails (see log below)
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.10.3
BuildVersion: 14D136
$ npm -v
2.7.4
why npm info atom-shell don't point to https://github.com/atom/atom-shell ?
Β± |master β| β npm install electron-prebuilt -g
/usr/local/bin/electron -> /usr/local/lib/node_modules/electron-prebuilt/cli.js
> [email protected] install /usr/local/lib/node_modules/electron-prebuilt
> node install.js
Downloading electron-v0.25.1-darwin-x64.zip
Error: certificate not trusted
/usr/local/lib/node_modules/electron-prebuilt/install.js:16
throw err
^
Error: certificate not trusted
npm ERR! Darwin 14.0.0
npm ERR! argv "/usr/local/bin/iojs" "/usr/local/bin/npm" "install" "electron-prebuilt" "-g"
npm ERR! node v1.0.2
npm ERR! npm v2.1.18
npm ERR! code ELIFECYCLE
Am I missing something?
Is there anything I can do help figure out what happened? Were you on 0.1.0 or 0.2.0 when the 0.28.2 release happened?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.