Yarn zip command fails

I have done a lot of searching here and elsewhere and haven’t been able to find a solution yet.

I’ve got yarn and node and gulp installed for my development theme. I’m trying to .zip the theme so I can upload it to my hosted ghost site. I have not been able to get yarn zip to fully execute. Each run produces this:

yarn run v1.22.22
warning source-dnn@1.0: The engine "ghost" appears to be invalid.
$ gulp zip
[09:32:16] Using gulpfile ~/Sites/.../content/themes/source-dnn/gulpfile.js
[09:32:16] Starting 'zip'...
[09:32:16] Starting 'css'...
[09:32:16] Finished 'css' after 198 ms
[09:32:16] Starting 'js'...
[09:32:16] Finished 'js' after 438 ms
[09:32:16] Starting 'locales'...
[09:32:16] Finished 'locales' after 2.81 ms
[09:32:16] Starting 'zipper'...
[09:32:16] 'zipper' errored after 1.06 ms
[09:32:16] TypeError: zip is not a function
    at zipper (/Users/.../content/themes/source-dnn/gulpfile.js:86:9)
    at bound (node:domain:433:15)
    at runBound (node:domain:444:12)
    at asyncRunner (/Users/.../content/themes/source-dnn/node_modules/async-done/index.js:52:18)
    at process.processTicksAndRejections (node:internal/process/task_queues:85:11)
[09:32:16] 'zip' errored after 642 ms
error Command failed with exit code 1.

I’m assuming the problem is TypeError: zip is not a function, but I haven’t been able to find anything regarding this.

Ghost version 6.22.1

Ghost-cli version 1.28.4

NPM version 10.9.4

Node version 22.22.0

Yarn version 1.22.22

Gulp version 5.0.1 (local) 3.1.0 (cli)

Running yarn add gulp-zip@5.1.0 --dev fixed it.

I had the same issue. It was an incompatibility problem between node v22 required for running ghost and building the zipfile with gulp which requires a lower version of node.

I threw out gulp and replaced it with vite and postcss.