This repository has been archived by the owner on Jun 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 340
Build Napa.js for Electron
Yulong Wang edited this page Dec 27, 2017
·
1 revision
In order to use Napa.js under Electron, we need to follow some extra steps to build Napa.js from source. This is because Electron is using its own Node.js runtime, which is not compatible with Napa.js pre-built binaries.
- Prepare Build prerequisites
- In
<your-electron-module-folder>
usenpm install napajs --save
to install Napa.js - Open
<your-electron-module-folder>\node_modules\napajs\package.json
and add the following lines:See https://github.com/cmake-js/cmake-js#electron for more information."cmake-js": { "runtime": "electron", "runtimeVersion": "<your-electron-runtime-version>", "arch": "x64" },
- In
<your-electron-module-folder>\node_modules\napajs
runcmake-js rebuild
- Now you are ready to use Napa.js in your Electron module.