Prerequisites
Before installing Zerox, ensure you have:- Node.js 14 or higher
- npm, yarn, or pnpm package manager
- System access to install dependencies (GraphicsMagick, Ghostscript)
Installation
Install the package
Install Zerox using your preferred package manager:
The package includes a postinstall script that will attempt to automatically install system dependencies (GraphicsMagick, Ghostscript, LibreOffice, and Poppler).
Install system dependencies
Zerox requires GraphicsMagick and Ghostscript for PDF processing. These are typically installed automatically during the npm install process, but you may need to install them manually.For processing non-PDF document formats (DOCX, XLSX, etc.), also install LibreOffice:
- Linux (Ubuntu/Debian)
- macOS
- Windows
Verification Commands
Verify that system dependencies are correctly installed:Troubleshooting
Error: 'gm' command not found
Error: 'gm' command not found
GraphicsMagick is not installed or not in your system PATH.Solution:
- On Linux: Run
sudo apt-get install -y graphicsmagick - On macOS: Run
brew install graphicsmagick - On Windows: Download and install from the official website, then add to PATH
Error: 'gs' command not found
Error: 'gs' command not found
Ghostscript is not installed or not in your system PATH.Solution:
- On Linux: Run
sudo apt-get install -y ghostscript - On macOS: Run
brew install ghostscript - On Windows: Download and install from ghostscript.com, then add to PATH
PDF conversion fails with 'operation not permitted' error
PDF conversion fails with 'operation not permitted' error
This is often caused by security policies in newer versions of Ghostscript or ImageMagick.Solution (Linux/macOS):
Edit the Ghostscript policy file:Add or modify the PDF policy line:
Postinstall script fails with permission errors
Postinstall script fails with permission errors
The automatic dependency installation may fail if you don’t have sudo access.Solution:
- Install system dependencies manually using the commands in Step 2
- If using npm, you can skip the postinstall script with:
npm install --ignore-scripts zerox - Then manually install the system dependencies
Module not found after installation
Module not found after installation
TypeScript types or module resolution issues.Solution:Make sure your
tsconfig.json has proper module resolution:DOCX/XLSX files not processing
DOCX/XLSX files not processing
LibreOffice is required for non-PDF document formats.Solution:
Install LibreOffice:
- Linux:
sudo apt-get install -y libreoffice - macOS:
brew install --cask libreoffice - Windows: Download from libreoffice.org
soffice --versionDependencies Reference
Zerox uses the following system dependencies:| Dependency | Purpose | Required |
|---|---|---|
| GraphicsMagick | Image processing and PDF-to-image conversion | Yes |
| Ghostscript | PDF rendering engine | Yes |
| LibreOffice | Convert DOCX, XLSX, PPT to PDF | Optional |
| Poppler | Alternative PDF utilities | Optional |
Next Steps
Quick Start
Start using Zerox with your first OCR document
Configuration
Configure models, providers, and processing options

