Strange error when deploying our capacitor-based app to fdroid

We have a strange problem when we try to deploy our app to the fdroid store and they don’t seem to be able to help us further with this.

The problem is that this error does not happen locally and also not in our CI nor in their gitlab pipeline and only for their build server and the error message is just Illegal instruction:

`Run `npm audit` for details.
npm notice 
npm notice New major version of npm available! 8.19.4 -> 9.6.5
npm notice Changelog: <>
npm notice Run `npm install -g npm@9.6.5` to update!
npm notice 
+ npm run build

> graphhopper-maps@0.0.0 build
> webpack --config

Illegal instruction
==== detail end ====
2023-04-25 02:28:37,020 DEBUG: Error encoutered, stopping by user request.
==== detail end ====`

See here for the build script.

Does anyone has an idea what could be wrong here or what we could try? We already tried to install npm in a different way but without success (first attempt, second attempt)