This repository was archived by the owner on Jun 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 333
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 --saveto install Napa.js - Open
<your-electron-module-folder>\node_modules\napajs\package.jsonand 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\napajsruncmake-js rebuild - Now you are ready to use Napa.js in your Electron module.