Requirements
Before building OpenComic, ensure you have the following installed:Git
For cloning the repository
Node.js
Version 14 or higher recommended
npm
Comes with Node.js
Development setup
Clone and install
The first run may take longer as it compiles TypeScript files and generates necessary resources.
Development scripts
| Script | Purpose |
|---|---|
npm start | Launch OpenComic in development mode |
npm run watch | Watch for TypeScript changes and recompile |
npm test | Run tests and ESLint |
npm run eslint | Run ESLint on source files |
Building for production
Update from main branch
Before building, ensure you have the latest code:Build commands
Use the following commands to build for specific platforms:- Windows
- macOS
- Linux
- Linux ARM64
Build output
All build artifacts are created in thedist/ directory:
Troubleshooting build issues
Build fails with 'Not exists' error (Linux/macOS)
Build fails with 'Not exists' error (Linux/macOS)
This error typically occurs with native dependencies. To fix:Then retry your build command.
Node-gyp build errors
Node-gyp build errors
Ensure you have build tools installed:Windows:macOS:Linux:
Sharp/native module errors
Sharp/native module errors
Electron build fails
Electron build fails
Clear Electron cache and reinstall:
TypeScript compilation errors
TypeScript compilation errors
Ensure TypeScript is compiled before building:
Build customization
Electron Builder configuration
Build settings are configured inpackage.json under the build section:
Changing app metadata
Editpackage.json to change:
- Application name:
nameandproductName - Version:
version - Description:
description - Author:
author - License:
license
Custom build scripts
You can create custom build scripts by adding them to thescripts section in package.json:
Platform-specific notes
Windows
Windows
- Portable builds: Create self-contained executables that don’t require installation
- Folder portable: Includes app data folder alongside executable for true portability
- Code signing: Required for production releases to avoid Windows SmartScreen warnings
macOS
macOS
- Notarization: Required for distribution outside the Mac App Store
- Universal builds: Use
--universalflag to create Intel + Apple Silicon builds - Certificates: Requires Apple Developer account and certificates
- Configure notarization in
./build/notarize.env
Linux
Linux
- Snap: Requires snapcraft installed:
sudo snap install snapcraft --classic - Flatpak: May require additional flatpak-builder dependencies
- AppImage: Most portable option, works on most distributions
- Repository builds: Available on AUR for Arch Linux users
Contributing builds
If you’re building OpenComic for contribution:- Fork the repository on GitHub
- Create a feature branch for your changes
- Test your build thoroughly
- Submit a pull request with detailed description
Continuous Integration
OpenComic uses GitHub Actions for automated builds. See.github/workflows/ for CI configuration.
