nw-builder is a robust utility for creating, running, and packaging desktop applications built with NW.js across macOS, Windows, and Linux platforms. The package is currently at version 4.17.7 and maintains an active development cycle, releasing frequent patch updates and occasional minor feature enhancements, often on a weekly or bi-weekly basis. It distinguishes itself by offering comprehensive features such as fetching NW.js binaries, integrating community-built FFmpeg for proprietary codec support, customizing executable metadata, managing application icons, and downloading from alternative mirrors. A critical consideration for developers is ensuring Node.js ABI compatibility, as `nw-builder` strongly recommends matching the host system's Node.js version to the one embedded in the target NW.js release to prevent issues with native Node.js modules.
npm install nw-builderVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to programmatically build a multi-platform NW.js desktop application using `nw-builder`, including creating a minimal project structure and configuring common build options.
Migrate CommonJS `require()` calls to `import('nw-builder').then(m => m.default)` or refactor to use native ES Modules.Always consult the NW.js versions manifest (`nwjs.io/versions.json`) to determine the correct Node.js version for your target NW.js build. Use a Node version manager (e.g., nvm, volta) to switch to the recommended Node.js version before installing or rebuilding native modules.
Review the FFmpeg license constraints (e.g., LGPL, GPL) before enabling the `ffmpeg: true` option in your `nwbuild` configuration. Consider the implications for redistribution.
For CLI usage, pass the application directory as the last argument (`npx nwbuild /path/to/app`) or explicitly use `--srcDir=/path/to/app`. For programmatic usage, ensure `srcDir` is set correctly in the options object.
Refactor your import statement to use dynamic ESM `import('nw-builder').then(m => m.default)` or convert your file to an ES Module.Identify the Node.js version embedded in your target NW.js release (via `nwjs.io/versions.json`). Use a Node version manager (like NVM or Volta) to switch to that exact Node.js version, then reinstall or rebuild your native Node.js modules for your application.
Ensure the `srcDir` option (or the last argument in CLI) points to the root directory of your NW.js application. Verify the path is correct and accessible.
No dependency data recorded yet.