Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

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.

  1. Prepare Build prerequisites
  2. In <your-electron-module-folder> use npm install napajs --save to install Napa.js
  3. Open <your-electron-module-folder>\node_modules\napajs\package.json and add the following lines:
    "cmake-js": {
      "runtime": "electron",
      "runtimeVersion": "<your-electron-runtime-version>",
      "arch": "x64"
    },
    See https://github.com/cmake-js/cmake-js#electron for more information.
  4. In <your-electron-module-folder>\node_modules\napajs run cmake-js rebuild
  5. Now you are ready to use Napa.js in your Electron module.
Clone this wiki locally