diff --git a/cli/src/build.ts b/cli/src/build.ts index 8eaad78b96..253201246f 100644 --- a/cli/src/build.ts +++ b/cli/src/build.ts @@ -305,6 +305,21 @@ export class BuildCommand extends Command { } if (this.useZig || isCrossForLinux || isCrossForMacOS) { + try { + execSync('zig version') + } catch (e) { + if (this.useZig) { + throw new TypeError( + `Could not find ${chalk.green('zig')} on the PATH`, + ) + } else { + debug( + `Could not find ${chalk.green( + 'zig', + )} on the PATH, fallback to normal linker`, + ) + } + } const zigABIVersion = this.zigABIVersion ?? (isCrossForLinux && triple.abi === 'gnu') ? DEFAULT_GLIBC_TARGET