Is there any reason you add @types/node inside the prebuild ? (You may not need that. you can remove the prebuild or remove installing @types/node in prebuild)
Remove npm install in build step
"build": "npx prisma generate && next build",
and try this version for the node types
"@types/node": "^20.8.10"