Okay so just to confirm this is caused by an error in sharp, try creating a file called test-sharp.js in your nodebb directory with the following contents:
'use strict'; const fs = require('fs/promises'); const sharp = require('sharp'); async function run() { const input = await fs.readFile('public/logo.png'); await sharp(input) .resize({ width: 100 }) .toFile('build/public/logo.png'); } run().then(() => {}, err => setTimeout(() => { throw err; }, 0));Then run it like node test-sharp.js. It should create the file build/public/logo.png. Check the exit code with echo $?.