This is a workaround for an issue in Wiki.js v3-alpha
(and likely earlier versions) where a "Cannot find package 'pako'" error occurs when trying to render the page. As discussed in requarks/wiki#7096.
The quickest way to resolve this is to manually install the pako package within the Wiki.js Docker container.
Using docker-compose
:
docker-compose exec wiki npm install pako
After running this command, you may need to re-save the affected page to trigger a successful render.
Using docker
:
docker exec <id> npm install pako
Replace with the actual ID of your Wiki.js container. After running this command, you may need to re-save the affected page to trigger a successful render.
Because the pako package needs to be reinstalled after a docker-compose down
operation, a more persistent solution is needed. This involves a bash script and a systemd service (for linux - tested on Ubuntu Server 24)
- Create a bash script (e.g.
pako_patch.sh
) in the same directory as your docker-compose.yml file- Write your own bash script, using the suggested command
docker-compose exec -T wiki npm install pako
, or use the file below which handles retries and basic gotchas.
- Write your own bash script, using the suggested command
- Create a systemd service (e.g.
pako-patch.service
) in/etc/systemd/system/
- Write your own, or use the file below - ensuring you change the directory to yours.
- Enable, and start the service
sudo systemctl enable pako-patch.service
sudo systemctl start pako-patch.service
- The given service runs when the system boots, or if the script failed.
You can always run the bash script manually after recreating the containers with docker-compose up -d
.
This fix was tested on Wiki.js 3.0.0-alpha.386
(the latest alpha release at the time of writing). This workaround is temporary. Once Wiki.js v3 reaches beta or a stable release, this script and service should no longer be necessary, as the issue will likely be resolved upstream. You should then remove the script and disable the service (if you created one).