arboleya / electrify Goto Github PK
View Code? Open in Web Editor NEWPackage your Meteor apps with Electron, and butter
License: MIT License
Package your Meteor apps with Electron, and butter
License: MIT License
Hello! Sorry for my meteor incompetence, but I have some issue:
I built my app on Win10, launched the exe file and it worked perfectly. But when I move the packaged directory to another folder in my computer and try to run exe there, the project refuse to launch.
Could you please comment upon possible causes of this or provide some hints on how to fix it.
Thanks!
I started with a fresh node-meteor-electrify installation on WIndows 8, and did an "electrify package" on the exemple app that a "meteor create" gives. Everything works fine when wifi or ethernet connexion is available. But if my network is off, nothing happens when I click on the .exe (the Electron process is running but nothing shows up). Then if I establish a network connection, the app finally launches proprerly.
Is there a way to create a complete offline app with electrify ? I tried with a Meteor.disconnect() on Meteor.startup but didn't work either.
Hello,
electrify was working great so far. Currently I'm having some issues to compile for OSX. Other platforms run just fine. But in OSX it took 2 hours but didn't pass the line:
bundling meteor
so I cut it off.
Could you please have a look at this ?
Thanks
Thank you for this! I was able to get your method to work more easily than others. I can build an app just fine (I'm on Windows 10), but I can't figure out how to set the icon. Only thing I knew to try was adding "icon":"myfileName.ico" to the .electrify/package.json object. And, I've tried it with the image file in the root folder and the .electrify folder, if that matters. I wasn't sure.
How can I use Electrify with menubar?
I took a working electron+menubar app and tried to integrate meteor with Electrify. But can't get it working...
Is it something with how menubar hooks into the electron app
? Maybe here?
Tried this:
var app = require('app');
var menubar = require('menubar');
var electrify = require('electrify')(__dirname);
var mb = null;
app.on('ready', function() {
// gets here
console.log('app ready');
electrify.start(function(meteor_root_url) {
// gets here
console.log('electrify started');
mb = menubar({
index: meteor_root_url,
});
mb.on('ready', function() {
// never gets here
console.log('menubar ready');
});
});
});
Also tried:
electrify.start(function(meteor_root_url) {
// gets here
console.log('electrify started');
mb = menubar({
index: meteor_root_url,
});
mb.on('ready', function() {
// never gets here
console.log('menubar ready');
});
});
There are no errors in the console and an electron app starts but there is no window or tray icon.
Any help would be much appreciated!
From the docs i have realized that desktopCapturer electron API can be accessed only from IPCrenderer and not from IPCmain. Is there a way around this using Electrify?
What i want to understand is that if index.js inside .electrify folder is the main process (i.e has IPCMAIN) then one of the client .js file would have the IPCRenderer but in this case i have to include electron node module inside the meteor app to initiate the IPCRenderer. I dont want to include electron node_module as dependency for meteor
Hello. I know I can methods defined on electrify from meteor, as described on the docs. But can I call methods from meteor on my electrify App? I need this because I'm using serialport and when my electron app receives data from the port, I need to communicate this to Meteor
I don't know if it's a typo or a real possibility : your readme says you can create a win32 app by running electrify on win64, and that's exactly what I need to do. How can I do this ?
20150910-16:21:22.859(12)? (STDERR)
W20150910-16:21:22.860(12)? (STDERR) C:\Sandpit\leaderboard.electrify\node_modules.bin\electron.cmd:1
W20150910-16:21:22.860(12)? (STDERR) (function (exports, require, module, __filename, __dirname) { @if EXIST "%~dp0
W20150910-16:21:22.860(12)? (STDERR) ^
W20150910-16:21:22.864(12)? (STDERR) SyntaxError: Unexpected token ILLEGAL
W20150910-16:21:22.864(12)? (STDERR) at Module._compile (module.js:439:25)
W20150910-16:21:22.864(12)? (STDERR) at Object.Module._extensions..js (module.js:474:10)
W20150910-16:21:22.864(12)? (STDERR) at Module.load (module.js:356:32)
W20150910-16:21:22.864(12)? (STDERR) at Function.Module._load (module.js:312:12)
W20150910-16:21:22.864(12)? (STDERR) at Function.Module.runMain (module.js:497:10)
W20150910-16:21:22.864(12)? (STDERR) at startup (node.js:119:16)
W20150910-16:21:22.865(12)? (STDERR) at node.js:929:3
Also tried to bundle it as a app using the NPM tools, it says it completed ok, but no program is in the .dist folder.
when use asar archives option with electron-packager . the application show empty screen until i run meteor by my self in other terminal and show this message:
electrify:plugins:mongodb: app in development mode, skipping start
electrify:plugins:nodejs: app in development mode, skipping start
This is self explanatory, but npm creates the debug log file that can easily break git integration because can change often on every client and it's not useful at all in the repository.
Please remove it by default.
Hi,
Electrify has been amazing so far.. Thanks. I have the below query/
As part of my a requirement, i use a Electron API to get a set of data that i need to re-actively display in the contained meteor app? Can this be done by inserting the data to some shared mongodb so that the meteor app can read from the collection.
if so an example would be helpful.
Thanks
Meteor server won't start after installing this package.
I'm using Ubuntu 14.04.2 LTS 64-bit.
Below is the error:
I20150713-10:53:18.253(8)? => No METEOR_SETTINGS passed in, using locally defined settings.
I20150713-10:53:18.405(8)? electrify: installing electrified dependencies
W20150713-10:56:44.046(8)? (STDERR)
W20150713-10:56:44.047(8)? (STDERR) events.js:72
W20150713-10:56:44.047(8)? (STDERR) throw er; // Unhandled 'error' event
W20150713-10:56:44.047(8)? (STDERR) ^
W20150713-10:56:44.050(8)? (STDERR) Error: spawn ENOENT
W20150713-10:56:44.050(8)? (STDERR) at errnoException (child_process.js:1011:11)
W20150713-10:56:44.050(8)? (STDERR) at Process.ChildProcess._handle.onexit (child_process.js:802:34)
I ran the command on my app and i just get an error as it is trying to reference a non-existent folder on OS X
Error: Cannot find module '/Dash-Control-Cards/.electrify/node_modules/electron-prebuilt/package.json'/Dash-Control-Cards/.meteor/local/build/programs/server/boot.js:142:18)
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Npm.require (
at package_app (packages/arboleya:electrify/index.meteor.js:317:1)
at release (packages/arboleya:electrify/index.meteor.js:167:1)
at repl:1:2
at ~/Dash-Control-Cards/.meteor/local/build/programs/server/shell-server.js:243:23
Hello, how can I communicate between electron and meteor app?
I'm trying to use ipc but I can't make it work =(
Could you please help me ?
Hi,
When I running app with :
cd leaderboard
electrify
works great =D
Now here is the error I by running :
electrify package
I had the same error 1.4.0
version in meteor shell
The same path
C:\Users\RBOUDE~1.AEI\AppData\Local\Temp\Electrify\bundling\bundle
exist
C:\Users\r.boude***.AEI_02\AppData\Local\Temp\electrify\bundling\bundle
exist
An explanation ?
It's a great job ! Thanks ;-)
Does meteor need to be installed when you want to run the generated .exe?
Because when I run the exe on another windows pc which does not have meteor installed. The following error occurs (runs fine on the pc that packaged it):
Error: ENOENT: no such file or directory, open 'C:\Users\...\Appdata\Local\.meteor\meteor.bat'
If this is the case then why is meteor bundled in the generation process?
The resulting executable is for win32 and ia32
Both the generation and testing was performed on a windows 10 x64 pc.
Both package / app looks like providing the same functionality.
Any difference in the philosophy or the development team behind ?
Project in question : https://github.com/jrudio/meteor-electron
Thanks !
Would be nice if there was some way to append to the build process. For example, updating PList content.
I have been testing electrify from a blank project but it seems that the callback function within electrify.start() is never called.
Another problem is that my cpu goes crazy on the node process (I tried only on osx).
It does start the meteor process but nothing else happen and I cannot know within the electrify code if it started correctly.
seyan:tester deeeed$ electrify
Changes to your project's package version selections:
arboleya:electrify added, version 2.1.4
arboleya:electrify: Package your Meteor apps with Electron, and butter.
INFO electrify:index: initializing
INFO electrify:plugins: use mongodb
INFO electrify:plugins: use nodejs
INFO electrify:plugins: use socket
INFO electrify:app: initialize app
INFO electrify:scaffold: ensuring basic structure
INFO electrify:app: ensuring electrify dependencies
INFO electrify:plugins: acquire
INFO electrify:plugins:mongodb: acquiring mongo
INFO electrify:plugins:mongodb: acquiring mongod
INFO electrify:plugins:nodejs: acquiring nodejs
INFO electrify:plugins:socket: nothing to acquire, skipping
[[[ electron /Users/deeeed/WebstormProjects/tester/.electrify` ]]]
INFO electrify:index: initializing
INFO electrify:plugins: use mongodb
INFO electrify:plugins: use nodejs
INFO electrify:plugins: use socket
INFO electrify:index: start
INFO electrify:app: running app
INFO electrify:app: ensuring electrify dependencies
INFO electrify:plugins: load configured plugins []
INFO electrify:plugins: acquire
INFO electrify:plugins:mongodb: mongo already acquired, moving on
INFO electrify:plugins:mongodb: mongod already acquired, moving on
INFO electrify:plugins:nodejs: nodejs already acquired, moving on
INFO electrify:plugins:socket: nothing to acquire, skipping
INFO electrify:plugins: start
INFO electrify:plugins:mongodb: app not packaged, skipping start
INFO electrify:plugins:socket: starting socket
SockJS v0.3.16 bound to "/electrify"
INFO electrify:index: socket listening at 11235
INFO electrify:plugins:nodejs: app not packaged, skipping start
INFO electrify:app: starting meteor
[[[[[ ~/WebstormProjects/tester ]]]]]
=> Started proxy.
=> Started MongoDB.
GET /electrify/info 4ms 200
=> Started your app.
=> App running at: http://localhost:3000/
GET /electrify/390/0o2dxncq/websocket 4ms (unfinished)
I20160424-10:10:12.883(2)? electrify:meteor:index@server: connection is open
The electron icon is running in the dock but the Browser window is never launched.
Did I miss something for electrify.start() ?
Maybe it is only supposed to work after being packaged ?
Thanks
Hi, when I compile the app (go to app's folder, >meteor shell, >electrify), it runs normally on the first time (app/.electrify/.dist/Electrified-linux-x64/Electrified) but when I close it and run again, I get a white empty screen... the window's title also changes to "Electron" instead of "electrify"... if I do >meteor shell >electrify again, the proccess repeats and I can see the app again (only for the first time running)
I tried both
$ meteor run
$ electrify
But both are not working and in the browser console,
Meteor is not defined
This is what I get..
head
title Marker
meta(charset="UTF-8")
meta(name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui")
body
.editor-container
.textarea-wrapper
.textarea-header
.left
span MARKDOWN
.preview-wrapper
.preview-header
.left
span MARKDOWN
This is all I have done in my project so far.
Hi,
I'm getting the following error after giving the command 'electrify'. I tested on Windows and a Mac with the leaderboard sample application. I checked, there is no 'electron-prebuilt' in the node_modules folder (only a .bin and shelljs folder).
Error: Cannot find module '/Users/dev/Documents/Dev/d/leaderboard/.electrify/node_modules/electron-prebuilt/package.json'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Npm.require (/Users/dev/Documents/Dev/d/leaderboard/.meteor/local/build/programs/server/boot.js:142:18)
at package_app (packages/arboleya:electrify/index.meteor.js:317:1)
at release (packages/arboleya:electrify/index.meteor.js:167:1)
at repl:1:2
at /Users/dev/Documents/Dev/d/leaderboard/.meteor/local/build/programs/server/shell-server.js:243:23
Hey there,
This is an awesome project.
Maybe a total noob question here, but is there a nice way to connect the electrify version my app to a deployed app (e.g. myapp.meteor.com)?
Was thinking about using this to make a desktop version of an open source video chatroom I've thrown together. Electrify version of the app works like a charm locally, but I'd want to be able to connect peers on different computers obviously :)
Thanks for your help!
Thanks for this package- I'm trying to open links defined in my app in the user's default browser. I found this electron documentation, but unsure if it's possible call from meteor side?
https://github.com/atom/electron/blob/master/docs/api/shell.md
I am very interested by the output associated with "plugins" when starting or bundling an electrified app. Is it possible in the Electrify.app.package()
step, to specify not to include MongoDB at all?
For instance, I have an application that never reads or writes to any kind of collection. There are no users. Therefore, I see no reason to bundle Mongo with a deployed .exe or .app.
Additionally, I'm not sure if this could somehow improve load time, but I'd very much like to try. Is there any mechanism in your build process that could enable this?
I20151009-17:54:03.332(-4)? INFO electrify:app: bundling meteor
W20151009-17:54:03.597(-4)? (STDERR) fs.js:439
W20151009-17:54:03.597(-4)? (STDERR) return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
W20151009-17:54:03.597(-4)? (STDERR) ^
W20151009-17:54:03.598(-4)? (STDERR) Error: ENOENT, no such file or directory '/var/folders/jp/1p1ny1kx2jb3t4jb36ygg7580000gn/T/electrify/bundling/bundle/settings.json'
W20151009-17:54:03.598(-4)? (STDERR) at Object.fs.openSync (fs.js:439:18)
W20151009-17:54:03.598(-4)? (STDERR) at Object.fs.writeFileSync (fs.js:978:15)
W20151009-17:54:03.598(-4)? (STDERR) at ChildProcess.<anonymous> (/Users/lacymorrow/.meteor/packages/arboleya_electrify/.1.4.0.4gvna4++os+web.browser+web.cordova/npm/node_modules/electrify/lib/app.js:71:8)
W20151009-17:54:03.598(-4)? (STDERR) at ChildProcess.emit (events.js:98:17)
W20151009-17:54:03.599(-4)? (STDERR) at Process.ChildProcess._handle.onexit (child_process.js:820:12)
Adding arboleya:electrify
to Meteor projects causes them to crash on boot. This happens in both Windows 8.1 and Windows 10 (separate computers). This happens with pre-existing projects as well as the leaderboard example:
=> Started proxy.
=> Started MongoDB.
I20150914-18:49:10.001(-4)? electrify: installing electrified dependencies
I20150914-18:49:10.297(-4)? electrify: launching electron
=> Started your app.
=> App running at: http://localhost:3000/
Type Control-C twice to stop.
W20150914-18:49:10.328(-4)? (STDERR)
W20150914-18:49:10.328(-4)? (STDERR) module.js:340
W20150914-18:49:10.328(-4)? (STDERR) throw err;
W20150914-18:49:10.328(-4)? (STDERR) ^
W20150914-18:49:10.328(-4)? (STDERR) Error: Cannot find module 'C:\Users\Mark Solters\Documents\GitHub\leaderboard\.elec
trify\node_modules\electron-prebuilt\cli.js'
W20150914-18:49:10.328(-4)? (STDERR) at Function.Module._resolveFilename (module.js:338:15)
W20150914-18:49:10.328(-4)? (STDERR) at Function.Module._load (module.js:280:25)
W20150914-18:49:10.328(-4)? (STDERR) at Function.Module.runMain (module.js:497:10)
W20150914-18:49:10.328(-4)? (STDERR) at startup (node.js:119:16)
W20150914-18:49:10.328(-4)? (STDERR) at node.js:929:3
But, if I cd .\.electrify
and then manually install NPM dependencies with npm install
, everything works. This took me a while to figure out by trial and error. I'm not sure why this is not actually being done when it says "Installing electrified dependencies."
Thanks again for all your help in cleaning up the packaging process. The new version with Electrify.app.package()
is far more stable.
But the problem is, while the build and packaging process now works for me on Windows (10), the final .exe doesn't actually render anything. Although the packaging process throws no errors, the .exe doesn't render any application!
meteor
inside my app, then Electron successfully starts up along with the Meteor server.Electrify.app.package()
, it successfully creates an executable inside /.dist
./.dist
, I see inside the task manager that two Electron (32 bit) processes are spawned. For the leaderboard example, they take up 2.9MB and 13.7MB respectively. But, no window is ever created. No Electron app ever becomes visible. No icon appears in the task bar. Just those two processes, which must be killed using "End task."Hi, first of all, thanks for this promising package!
I'm giving a try to it and packaged the Meteor's demo "todos" app. The packaged app is working correctly inside the .dist directory but if I move the directory "Electrified-win32-ia32" elsewhere on the file system, it doesn't. The app is starting but nothing appears, the viewport stays blank.
Fabian
When trying to package my meteor app using electrify (version 2.1.4), I get the following error:
INFO electrify:index: initializing
INFO electrify:plugins: use mongodb
INFO electrify:plugins: use nodejs
INFO electrify:plugins: use socket
INFO electrify:app: bundling app
INFO electrify:scaffold: ensuring basic structure
INFO electrify:plugins: ensuring electrify dependencies
INFO electrify:plugins: load configured plugins []
INFO electrify:plugins: acquire
INFO electrify:plugins:mongodb: mongo already acquired, moving on
INFO electrify:plugins:mongodb: mongod already acquired, moving on
INFO electrify:plugins:nodejs: nodejs already acquired, moving on
INFO electrify:plugins:socket: nothing to acquire, skipping
INFO electrify:app: bundling meteor
INFO electrify:app: ensuring meteor dependencies
INFO electrify:electron: packaging "my-electrified-app" for platform linux-x64 using electron v0.35.6
Packaging app for platform linux x64 using electron v0.35.6
/usr/lib/node_modules/electrify/lib/electron.js:55
if(err) throw err;
^
Error: ENOENT: no such file or directory, stat '/home/[...]/.electrify/app/programs/server/npm/react-runtime-prod/node_modules/react/node_modules/envify/node_modules/jstransform/node_modules/esprima-fb/.#README.md'
When looking at the file it cannot find, it turns out to be a broken symlink with target "[email protected]". The folder does contains a valid file named "#README.md#", not sure if that has anything to do with this issue. Any ideas?
I20151216-15:45:48.489(0)? Exception while invoking method 'electrify.get.socket.por
t' Error: Did not check() all arguments during call to 'electrify.get.socket.port'
I20151216-15:45:48.489(0)? at [object Object]..extend.throwUnlessAllArgumentsHa
veBeenChecked (packages/check/match.js:411:1)
I20151216-15:45:48.489(0)? at Object.Match.failIfArgumentsAreNotAllChecked (pac
kages/check/match.js:106:1)
I20151216-15:45:48.489(0)? at maybeAuditArgumentChecks (livedata_server.js:1695:
18)
I20151216-15:45:48.489(0)? at livedata_server.js:708:19
I20151216-15:45:48.489(0)? at [object Object]..extend.withValue (packages/meteo
r/dynamics_nodejs.js:56:1)
I20151216-15:45:48.489(0)? at livedata_server.js:706:40
I20151216-15:45:48.490(0)? at [object Object]..extend.withValue (packages/meteo
r/dynamics_nodejs.js:56:1)
I20151216-15:45:48.490(0)? at livedata_server.js:704:46
I20151216-15:45:48.490(0)? at tryCallTwo (C:\Users\Geoff Davis\AppData\Local.me
teor\packages\promise\0.5.1\npm\node_modules\meteor-promise\node_modules\promise\lib
\core.js:45:5)
I20151216-15:45:48.490(0)? at doResolve (C:\Users\Geoff Davis\AppData\Local.met
eor\packages\promise\0.5.1\npm\node_modules\meteor-promise\node_modules\promise\lib
core.js:171:13)
Electrify: 2.1.4
Meteor: 1.2.1
Hello !
This looks wonderful, I've been trying and it almost work out of the box.
One weird behavior I've noticed is that if I double click the my-electrified-app.app
app, it does run some electron container but nothing shows up.
If I run ./dist/my-electrified-app-darwin-x64/my-electrified-app.app/Contents/MacOS/Electron
everything runs fine and the content shows up !
Thanks a lot !
Gabriel
INFO electrify:index: initializing
INFO electrify:plugins: use mongodb
INFO electrify:plugins: use nodejs
INFO electrify:plugins: use socket
INFO electrify:app: bundling app
INFO electrify:scaffold: ensuring basic structure
INFO electrify:plugins: ensuring electrify dependencies
INFO electrify:plugins: load configured plugins []
INFO electrify:plugins: acquire
INFO electrify:plugins:mongodb: mongo already acquired, moving on
INFO electrify:plugins:mongodb: mongod already acquired, moving on
INFO electrify:plugins:nodejs: nodejs already acquired, moving on
INFO electrify:plugins:socket: nothing to acquire, skipping
INFO electrify:app: bundling meteor
INFO electrify:app: ensuring meteor dependencies
INFO electrify:electron: packaging "my-electrified-app" for platform darwin-x64 using electron v0.35.6
Packaging app for platform darwin x64 using electron v0.35.6
INFO electrify:electron: wrote new app to /server/.electrify/.dist
I'm having trouble getting the Meteor settings to work.
electrify -s settings.json
doesn't seem to work for me. I've double checked that settings.json
is in the right path when I run the command.
Hi, I follow the instructions on my Linux Mint 17.1
meteor create --example leaderboard
cd leaderboard
meteor add arboleya:electrify
meteor
The process stalled at this:
I20150924-21:59:15.216(2)? electrify: installing electrified dependencies
I'm waiting more than 20 minutes.
And:
du -hs .electrify/
16K .electrify/
if it is worth to mention, I did this previously:
sudo npm install electrify -g
I love this approach and I would like to use electrify to package our app. I packaged our application last week at the beginning of the week and it worked well. But, I took a break from this project until yesterday when I started fresh, added the electrify package and then ran Electrify.app.package() from the shell. Everything seems to package fine, but now my app opens with a blank white page and won't load. I'm getting a bunch of undefined errors starting with: Uncaught TypeError: Cannot read property 'Electrify' of undefined
As I reflect, the errors actually start as soon as I add the electrify package, even before I package the app. Can you point me in the right direction?
Also note that your plugin works fine for me for simple apps like todos example and so on.
Thanks and awesome work, btw.
A month ago I mentioned on gitter a problem with high CPU usage on Mac OS X which makes it almost impossible to use electrify.
Possibly it have something to do with spawning child processes and stdout, because removing the option stdio: 'inherit'
(passed to spawn
) will let the CPU usage drop. Although we don't get output in the console anymore.
I got this error:
ReferenceError: Random is not defined
From this call within Meteor code:
Electrify.call('hello.world', ['anderson', 'arboleya'], function(err, msg) {
console.log(msg); // Hello anderson arboleya!
});
The error originated from this place in meteor/index.js:
var packet = {
handshake: Random.id(),
method: method,
args: args
};
I solved it by adding the random package to my meteor app like this:
meteor add random
Perhaps electrify assumes that it is available to use within all meteor-codebase, but it is no longer because it has been separated as an optional package? Just speculating. I am using Meteor 1.2.1 on a Windows 7 computer.
I tried different paths for the icon.png file but none seems to work and I can't find any documentation. What is the correct path to use? Also, is it relative to the main folder or the .electrify folder? Or an absolute path?
When installing a dependency using the .electrify/package.json file
{
"name": "my-electrified-app",
"main": "index.js",
"dependencies": {
"electrify": "2.0.2",
"serialport": "2.0.5"
}
}
and then running electrify
, it installs it but it builds a wrong version of it for Linux Mint 17 64bit.
It builds
.electrify/node_modules/serialport/build/Release/node-v11-linux-x64
(note the v11)
but then once you require('serialport')
, it tries to access
.electrify/node_modules/serialport/build/Release/node-v46-linux-x64
is of course isn't there so it throws and error and stop the app.
If I go into the .electrify
folder manually and then issue npm install serialport
it builds the correct(v46) version.
Since I'm kinda new to the node environment, is this something I have caused by doing something wrong or something else?
Node version
nodejs -v
: v4.2.2
node -v
: v4.2.2
Let me know if any additional information is required
Hey there!
Thanks for this package, it makes creating desktop apps so simple!
I have some questions, hope you're ok with me not opening a bunch of issues :D
Thanks again, great work!
Hi!
Since upgrade to meteor 1.3 (that uses a lot of npm modules now) my packaged app has grown to almost 400 mb (comparing to 200 on meteor 1.2). File count is up to 27,000 (twenty sevent bloody thousands) comparing to ~7000 on meteor 1.2, some of them exceed windows file path limit.
Well, it's kind a frustrating now to wait for 20 minutes (twenty!) to package app.
How can I reduce file count?
Possible solutions:
package parts of my app (at least node_modules I think) to asar archives
delete debugging information (*.map, css-parts, sass, etc)
delete npm_modules build information (I believe some node packages come disassebled and being compiled in meteor build stage)
prebuild electron part of app and replace only meteor part of application during build
PS: from electron-packager readme:
Be careful not to include node_modules you don't want into your final app. electron-packager, electron-prebuilt and .git will be ignored by default. You can use --ignore to ignore files and folders via a regular expression. For example, --ignore=node_modules/package-to-ignore or --ignore="node_modules/(some-package[0-9]*|dev-dependency)".
Eg:
app/
.meteor/
client/
server/
lib/
README.md
This won't work.
I get the above mentioned error on windows when I run
electrify package
but running
electrify
builds and runs my app in electron
The info below might help. How do I fix this.
D:\PROJECTS\METEOR\Aurelia\aurelia-meteor-todos-master>electrify package
INFO electrify:index: initializing
=====================================
{
"version": "2.0.2",
"running_through_cli": true,
"is_development_mode": false,
"is_running_tests": false,
"stdio": "inherit",
"sys": {
"platform": "win32",
"arch": "x64",
"is_windows": true,
"is_linux": false,
"is_osx": false
},
"os": {
"name": "win32",
"home": "C:\\Users\\UWASCAN",
"tmp": "C:\\Users\\UWASCAN\\AppData\\Local\\Temp"
},
"app": {
"root": "D:\\PROJECTS\\METEOR\\Aurelia\\aurelia-meteor-todos-master\\.electrify",
"meteor": "D:\\PROJECTS\\METEOR\\Aurelia\\aurelia-meteor-todos-master",
"is_packaged": false,
"isnt_packaged": true,
"bin": "D:\\PROJECTS\\METEOR\\Aurelia\\aurelia-meteor-todos-master\\.electrify\\bin",
"dist": "D:\\PROJECTS\\METEOR\\Aurelia\\aurelia-meteor-todos-master\\.electrify\\.dist",
"config_path": "D:\\PROJECTS\\METEOR\\Aurelia\\aurelia-meteor-todos-master\\.electrify\\electrify.json",
"settings": {}
},
"core": {
"tmp": "C:\\Users\\UWASCAN\\AppData\\Local\\Temp\\electrify",
"root": "C:\\Users\\UWASCAN\\AppData\\Local\\Temp\\electrify\\core"
},
"meteor": {
"root": "C:\\Users\\UWASCAN\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.10\\mt-os.windows.x86_32\\meteor.bat",
"tools": "C:\\Users\\UWASCAN\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.10\\mt-os.windows.x86_32\\",
"dev_bundle": "C:\\Users\\UWASCAN\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.10\\mt-os.windows.x86_32\\dev_bundle",
"server_lib": "C:\\Users\\UWASCAN\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.10\\mt-os.windows.x86_32\\dev_bundle\\server-lib",
"server_modules": "C:\\Users\\UWASCAN\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.10\\mt-os.windows.x86_32\\dev_bundle\\server-lib\\node_modules",
"node_mods": "C:\\Users\\UWASCAN\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.10\\mt-os.windows.x86_32\\dev_bundle\\bin\\node_modules",
"node": "C:\\Users\\UWASCAN\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.10\\mt-os.windows.x86_32\\dev_bundle\\bin\\node.exe",
"npm": "C:\\Users\\UWASCAN\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.10\\mt-os.windows.x86_32\\dev_bundle\\bin\\node_modules\\npm\\bin\\npm-cli.js",
"mongo": "C:\\Users\\UWASCAN\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.10\\mt-os.windows.x86_32\\dev_bundle\\mongodb\\bin\\mongo.exe",
"mongod": "C:\\Users\\UWASCAN\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.10\\mt-os.windows.x86_32\\dev_bundle\\mongodb\\bin\\mongod.exe"
}
}
====================================
INFO electrify:plugins: use mongodb
INFO electrify:plugins: use nodejs
INFO electrify:plugins: use socket
INFO electrify:app: bundling app
INFO electrify:scaffold: ensuring basic structure
INFO electrify:plugins: ensuring electrify dependencies
npm WARN package.json my-electrified-app@ No description
npm WARN package.json my-electrified-app@ No repository field.
npm WARN package.json my-electrified-app@ No README data
INFO electrify:plugins: load configured plugins []
INFO electrify:plugins: acquire
INFO electrify:plugins:mongodb: mongo already acquired, moving on
INFO electrify:plugins:mongodb: mongod already acquired, moving on
INFO electrify:plugins:nodejs: nodejs already acquired, moving on
INFO electrify:plugins:socket: nothing to acquire, skipping
INFO electrify:app: bundling meteor
WARNING: The output directory is under your source tree.
Message: Using Systemjs Loader...
Message: Using Aurelia Framework...
shell.js: internal error
Error: EXDEV, cross-device link not permitted 'C:\Users\UWASCAN\AppData\Local\Temp\electrify\bundling\bundle'
at Error (native)
at Object.fs.renameSync (fs.js:636:18)
at D:\PROJECTS\METEOR\Aurelia\aurelia-meteor-todos-master\.electrify\node_modules\electrify\node_modules\shelljs\src\mv.js:77:8
at Array.forEach (native)
at Object._mv (D:\PROJECTS\METEOR\Aurelia\aurelia-meteor-todos-master\.electrify\node_modules\electrify\node_modules\shelljs\src\mv.js:53:11)
at Object.mv (D:\PROJECTS\METEOR\Aurelia\aurelia-meteor-todos-master\.electrify\node_modules\electrify\node_modules\shelljs\src\common.js:186:23)
at ChildProcess.<anonymous> (D:\PROJECTS\METEOR\Aurelia\aurelia-meteor-todos-master\.electrify\node_modules\electrify\lib\app.js:134:11)
at ChildProcess.emit (events.js:110:17)
at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
The app works running 'meteor'. However, if I install electrify with 'npm install -g electrify' and then I run 'electrify' to get the following error:
Your app is crashing. Here's the latest log:
Started MongoDB.
Errors prevented startup:
While loading plugin `compileNGScript` from package `pbastowski:angular-babel`:
C:\Users\4379\AppData\Local\.meteor\packages\meteor-tool\1.1.10\mt-os.windows.x86_32\tools\static-assets\server\mini-files.js:34:13: Surprising path: /home/4379/data/projects/03_pricing-calculator/src/babel.json
at toDosPath (C:\Users\4379\AppData\Local\.meteor\packages\meteor-tool\1.1.10\mt-os.windows.x86_32\tools\static-assets\server\mini-files.js:34:13)
at Object.convertToOSPath (C:\Users\4379\AppData\Local\.meteor\packages\meteor-tool\1.1.10\mt-os.windows.x86_32\tools\static-assets\server\mini-files.js:47:12)
at Object.wrapper (C:\tools\fs\files.js:1310:25)
at getCustomConfig (packages/compileNGScript/plugin/ng-script-compiler.js:145:1)
at Package (packages/compileNGScript/plugin/ng-script-compiler.js:27:1)
at <runJavaScript-73>:170:4
at <runJavaScript-73>:177:3
Your application has errors. Waiting for file change.
INFO electrify:index: initializing
path.js:9
throw new TypeError('Path must be a string. Received ' +
^
TypeError: Path must be a string. Received undefined
at assertPath (path.js:9:11)
at win32.join (path.js:222:5)
at new Env (C:\Users\geoff\AppData\Roaming\npm\node_modules\electrify\lib\env.js:115:23)
at module.exports (C:\Users\geoff\AppData\Roaming\npm\node_modules\electrify\lib\env.js:6:10)
at new Electrify (C:\Users\geoff\AppData\Roaming\npm\node_modules\electrify\lib\index.js:16:30)
at module.exports (C:\Users\geoff\AppData\Roaming\npm\node_modules\electrify\lib\index.js:5:10)
at electrify (C:\Users\geoff\AppData\Roaming\npm\node_modules\electrify\bin\cli.js:148:23)
at Command.run (C:\Users\geoff\AppData\Roaming\npm\node_modules\electrify\bin\cli.js:96:5)
at Command.listener (C:\Users\geoff\AppData\Roaming\npm\node_modules\electrify\node_modules\commander\inde
x.js:301:8)
at emitTwo (events.js:88:13)
I have tried to run this on two separate machines and get the same problem.
meteor create --example leaderboard
cd leaderboard
meteor add arboleya:electrify
electrify
This works perfectly on a mac, it's just Windows 10 that I am having this problem. If I run meteor inside the leaderboard directory, I get:-
=> Started proxy.
=> Started MongoDB.
I20151213-10:19:03.500(0)? electrify:meteor:index@server: cannot initialize connection. Did you npm install -g electrify
?
I20151213-10:19:03.512(0)? install it and try running your meteor app with electrify
npm command
=> Started your app.
=> App running at: http://localhost:3000/
Type Control-C twice to stop.
I did perform 'npm install -g electrify' and can confirm that it can be reached on the command line.
Apparently there are some critical fixes in newer versions of the deps, can we update electrify with newer deps?
My basic app is already over 200MB.
Is it normal that apps built with electrify take this much disk space?
Error: EXDEV, cross-device link not permitted
This happens because shell.js
can't handle correctly the mv or cp operation from a disk to an other one.
A solution consist in using :
var run=require('sync-runner');
run("mv '" + src + "' '" + thisDest + "'");
This has been proved to work. I'll pull request later.
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.