Developer documentation
Linux Specific Pre-requisites#
- These are tested on Ubuntu 24.04.2 LTS and Ubuntu 22.04 LTS (thanks to "FP Coetzee")
System Requirements#
- Disk space ~1.2G for basic build.
- RAM: Minimum 4GB recommended (for Electron builds)
Pre-requisites#
- Ubuntu Packages:
git,build-essentialandxorg-dev
1. Install System Packages#
for ubuntu
sudo apt update && sudo apt install -y git build-essential xorg-devfor fedora
sudo dnf install -y xorg-x11-server-devel libxkbfile-devel2. Install Node#
- I recommend using nvm
Common Issues & Solutions#
Issue: pnpm install fails with native-keymap error#
Error message:
ERR_PNPM_OPTIONAL_DEPS_REQUIRER optional dep native-keymap failed
...
node-gyp ERR! build error
node-gyp ERR! gyp ERR! rebuildSolution:
This occurs when xorg-dev is missing. Install it:
sudo apt install xorg-devThen retry:
pnpm installIssue: Electron fails to start with libglib error#
Error message:
~/marktext/node_modules/electron/dist/electron: error while loading shared libraries:
libglib-2.0.so.0: cannot open shared object file: No such file or directorySolution: Install the X11/GUI development libraries:
sudo apt install xorg-devIf the issue persists, you may need the full X11 environment:
sudo apt install xorgIssue: Permission errors during pnpm install#
Solution:
Make sure you're not running pnpm commands with sudo. pnpm stores packages in a global content-addressable store (default: ~/.local/share/pnpm/store). If you encounter permission errors, ensure the store directory is owned by your user:
# Check and fix store ownership if needed
sudo chown -R $(whoami) ~/.local/share/pnpm