electron-native-modules

Package native Node.js modules in Electron apps with esbuild and electron-builder.

8|2|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/bradtaylorsf/alphaagent-team --skill electron-native-modules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: electron-native-modules
Source: https://github.com/bradtaylorsf/alphaagent-team/tree/main/plugins/aai-stack-electron/skills/electron-native-modules
Command: npx skills add https://github.com/bradtaylorsf/alphaagent-team --skill electron-native-modules

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexities of packaging native Node.js modules (like better-sqlite3, sharp, keytar) within Electron applications, ensuring they compile and run correctly across different platforms.

Core Features & Use Cases

  • Cross-Platform Compatibility: Provides configurations for esbuild and electron-builder to handle native module compilation and inclusion.
  • Module Management: Details specific patterns for common native modules, including database, image processing, and secure storage.
  • Use Case: When building an Electron app that requires a high-performance SQLite database (better-sqlite3) or image manipulation (sharp), this skill guides you through the necessary build and packaging steps to avoid runtime errors.

Quick Start

Configure your electron-builder.config.cjs file to include native modules and set npmRebuild to true.

Frequently Asked Questions about electron-native-modules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I package native Node.js modules like better-sqlite3 for an Electron app?

To package native Node.js modules for Electron, configure electron-builder with `npmRebuild` set to true and use esbuild configurations to handle cross-platform compilation and inclusion, avoiding runtime errors.

Why does sharp crash my Electron application at runtime?

Sharp and other native modules crash when not properly compiled for Electron's environment. Using the correct esbuild and electron-builder configurations ensures proper cross-platform compilation and deployment.

Does esbuild work with electron-builder to compile native modules?

Yes, esbuild works with electron-builder to manage native module compilation and inclusion. This combination provides the necessary cross-platform build configurations to ensure modules run correctly.

What is the best way to configure macOS entitlements for Electron native modules?

The best way to configure macOS entitlements for Electron native modules is to follow specific packaging and distribution guidelines that provide the necessary entitlements and troubleshooting steps for secure integration.

How do I fix better-sqlite3 cross-platform compilation issues in Electron?

Fix better-sqlite3 cross-platform compilation issues by applying the provided esbuild and electron-builder configurations, which manage the specific build patterns required for database modules within Electron applications.