Sketch2PDF uses an external script for the PDF file size compression which is a part of Ghostscript.
To make it work, you need to install Ghostscript on your machine. The easiest way to do that is via Homebrew - a package manager for macOS.
It may sounds complicated, but it's actually not. You just need to run a couple of Terminal commands.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install ghostscript
If you want to stop running of Sketch2PDF on PDF export, just disable the plugin from Plugins → Manage Plugins.
Sketch2PDF is based on SVGO Export.