"No Such Built in Module" error since 6.3.5

Since version 6.3.5 we get the following error when building the theme. It actually works fine on our local machines, but we run the build process directly on the server. When we do this we get the following error :

bud build

internal/process/esm_loader.js:74
internalBinding(‘errors’).triggerUncaughtException(
^

Error [ERR_UNKNOWN_BUILTIN_MODULE]: No such built-in module: node:path/posix
at new NodeError (internal/errors.js:322:7)
at Loader.builtinStrategy (internal/modules/esm/translators.js:285:11)
at new ModuleJob (internal/modules/esm/module_job.js:63:26)
at Loader.getModuleJob (internal/modules/esm/loader.js:258:11)
at async ModuleWrap. (internal/modules/esm/module_job.js:78:21)
at async Promise.all (index 1)
at async link (internal/modules/esm/module_job.js:83:9) {
code: ‘ERR_UNKNOWN_BUILTIN_MODULE’
}

Any suggestions?

So there are two variants of node:path, one for windows and one for posix (Linux-based and such).
As the posix variant is explicitly used for node:path in your case, it won’t work on Windows.
https://nodejs.org/api/path.html#windows-vs-posix

Are you building on Windows or on Linux (or WSL)?
Are you also locking the node version used for building? I use a .nvmrc to ensure a node version that is known to build successfully is used.

Thanks, based on your comment I think its likely that the node version on our hosting. (14.19) vs 16.17 locally is the issue.

So you build the theme on the web server (e.g. production) itself?
Following best practices (with many advantages) the theme (and everything else) should not be built on the web server, but rather on the workstation or a CI / build server and the build artifacts then transferred to web server.