import.meta.resolve(...).replace('file://', '') is not a correct way
to convert a file:// URL to a filesystem path. It always breaks on
Windows (leaves a leading slash before the drive letter, e.g.
/C:/Users/..., which downstream path.join/fs calls mangle into
C:\C:\Users\...), and it also breaks on any OS whenever the resolved
path contains a character that gets percent-encoded in a URL, most
commonly a space (e.g. file:///home/jane%20doe/... never gets decoded
back to "jane doe", so fs.readFileSync fails with ENOENT there too).
Use fileURLToPath() from node:url instead, which is Node's own
built-in, spec-correct URL-to-path converter and handles both cases.