Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 53956bf

Browse files
authored
docs: add FAQ about Electron (#1160)
* docs: add FAQ about Electron ref: #843 (comment) * Update README.md * Update README.md
1 parent b22f9a4 commit 53956bf

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ You can check the development status at the [Waffle Board](https://waffle.io/ipf
6464
- [Network](#network)
6565
- [Node Management](#node-management)
6666
- [Domain data types](#domain-data-types)
67+
- [FAQ](#faq)
6768
- [Packages](#packages)
6869
- [Development](#development)
6970
- [Clone and install dependencies](#clone-and-install-dependencies)
@@ -441,6 +442,29 @@ Yes, unfortunately, due to [Chrome aggressive resource throttling policy](https:
441442

442443
A way to mitigate this in Chrome, is to run your IPFS node inside a Service Worker, so that the IPFS instance runs in a background process. You can learn how to install an IPFS node as a service worker in here the repo [ipfs-service-worker](https://github.com/ipfs/ipfs-service-worker)
443444

445+
#### Can I use IPFS in my Electron App?
446+
447+
Yes you can and in many ways. Read https://github.com/ipfs/notes/issues/256 for the multiple options.
448+
449+
If your [electron-rebuild step is failing](https://github.com/ipfs/js-ipfs/issues/843), all you need to do is:
450+
451+
```bash
452+
# Electron's version.
453+
export npm_config_target=1.7.6
454+
# The architecture of Electron, can be ia32 or x64.
455+
export npm_config_arch=x64
456+
export npm_config_target_arch=x64
457+
# Download headers for Electron.
458+
export npm_config_disturl=https://atom.io/download/electron
459+
# Tell node-pre-gyp that we are building for Electron.
460+
export npm_config_runtime=electron
461+
# Tell node-pre-gyp to build module from source code.
462+
export npm_config_build_from_source=true
463+
# Install all dependencies, and store cache to ~/.electron-gyp.
464+
HOME=~/.electron-gyp npm install
465+
```
466+
467+
If you find any other issue, please check the [`Electron Support` issue](https://github.com/ipfs/js-ipfs/issues/843).
444468

445469
## Packages
446470

0 commit comments

Comments
 (0)