Electron - How can I install or use a third party dependency like a brew or apt-get package in my app? - electron

Currently I want to build a desktop app which is using a third party package that can be installed trough apt-get or brew but I do not know how to inject this dependency on my electron app.
I want to avoid ask the user to install this dependency before of use my app like "Hey to use this app you should have the Package A installed.".
Thanks for the help.

You can do it in the installer (Preferred). For example, You can create a debian for your app.
In the makefile of the debian, you can check if module is present or not, if not install.
OR
You can do it in the app first boot,
You can check if the user's system already has that module or not using child_process (spawning a terminal & executing a cmd to check if the module is present) or by writing a native node module to do the same.
If the module is not present, you can use child_process module to execute the command to install that module.

Related

How to install librabbitmq in App Engine Google Cloud Platform

I've been trying to install librabbitmq in App Engine GCP without any luck. https://github.com/celery/librabbitmq
All other pip packages install properly if they are in the requirements.txt via my yml file, however, this package does not work (missing compiler, gcc, etc).
How do you install this in App Engine?
I've tried both in Python2 and Python3 just in case, works ok for me.
Try to require a specific version,maybe that's your issue?
Here you have a simple requirements.txt, if that doesn't solve it give us more info.
Try this:
Flask==1.0.2
rabbitmq==0.2.0

Distributing Homebrew dependencies along with electron-packager

I have an electron application that has the following dependencies:
ffmpeg
libmagic
gdbm
Currently, I use Homebrew and run brew install ffmpeg etc. upon startup of the app.
However, this is terrible for distribution. Is there a way to distribute these dependencies packaged alongside my application so that the end user doesn't have to have Homebrew or deal with installation errors? I'm distributing my app using electron-packager to create a Desktop Mac app.
I gave the specific dependencies just for context -- hopefully there is a solution that would work with any generic dependency?
It is possible with dynamic linking
use https://www.npmjs.com/package/ffmpeg-static
Example Usage
Returns the path of a statically linked ffmpeg binary on the local filesystem.
var pathToFfmpeg = require('ffmpeg-static');
console.log(pathToFfmpeg);
/Users/j/playground/node_modules/ffmpeg-static/ffmpeg
check https://discuss.atom.io/t/information-about-bundled-ffmpeg/28456/6

Installation with Create React App

I'm sorry for asking what may be an obvious question to most, but I'm lost. I have created a react project with create-react-app. I want to add a third party library (Ant Design UI Framework) that uses .css styles. Ant will use global .css and the rest of my application can then use styleName.
After running npm install babel-plugin-react-css-modules --save what do I have to do to get this running? The documentation references the configuration but the individual steps required properly configure the app aren't clear at all—at least to me.
Can someone help with a bit of an "idiot's guide" to setting this up, and detail some of the steps?
Thanks,
Chris
Ant Design also have react native library as you can see here
You just need to run the following command on your project root to install it:
$ npm install antd-mobile --save

Homebrew install the old version of flow

I cd to my react-native project directory, and run flow, it prompts me Launching Flow server for /Users/... Wrong version of Flow. The config specifies version ^0.32.0 but this is version 0.33.0. How do I install the previous version flow with Homebrew?
If you run brew info flow in the console, you'll see a line similar to the following:
flow: stable 0.33.0 (bottled), HEAD
This means that the person managing the flow homebrew formula is removing old versions as the version gets updated, so it's impossible for you to access any old versions, barring performing some behind the scenes business I'm unaware of.
Luckily, there's a solution for you. I assume you're using npm, in which case you can try the following:
npm install flow-bin#0.32 -g
This will install a binary wrapper for flow, packaged through npm, in which previous versions are all available. By installing globally, you can use the flow commands in the command line.
If you don't want to install globally, for fear of conflicting with other projects, etc., you can still install locally and use flow:
npm install flow-bin#0.32
Now, add the following to package.json:
"scripts": {
...
"flow": "flow ."
},
And now, you'll be able to run flow on your project with the command:
npm run flow

twilio.rest missing from twilio python module version 2.0.8?

The Twilio python quickstart guide says to use a submodule called twilio.rest .
But after installing the twilio module today via sudo pip install twilio, which installed version 2.0.8, there appears to be no module (or object) called "rest" within the twilio module.
Where is twilio.rest?
There are two things you should check.
First, if you already have a package installed with pip, running pip install package-name will NOT upgrade the package. To upgrade the package to the newest version, run
pip install --upgrade twilio
Second, we often see this error occur because people named the file containing their Twilio code twilio.py. This means that trying to import twilio.rest will fail because Python is looking in the twilio.py file for the .rest module. To resolve the problem use a different filename.
If you have more problems with the twilio module and ImportError messages, there is a full set of documentation here: http://readthedocs.org/docs/twilio-python/en/latest/faq.html#importerror-messages
I had the same symptom but my problem was I named my view handler twilio.py. That caused a conflict with twilio library. Just name your py file something else like phone.py.

Resources