Skip to content
2 changes: 1 addition & 1 deletion src/frameworks/next/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ describe("Next.js utils", () => {
.withArgs("npx which esbuild", { encoding: "utf8" })
.returns(mockBinaryPath + "\n");
execSyncStub
.withArgs(`${mockBinaryPath} --version`, { encoding: "utf8" })
.withArgs(`"${mockBinaryPath}" --version`, { encoding: "utf8" })
.returns(`${mockGlobalVersion}\n`);

const consoleWarnStub = sinon.stub(console, "warn");
Expand Down
2 changes: 1 addition & 1 deletion src/frameworks/next/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ export function findEsbuildPath(): string | null {
*/
export function getGlobalEsbuildVersion(binPath: string): string | null {
try {
const versionOutput = execSync(`${binPath} --version`, { encoding: "utf8" })?.trim();
const versionOutput = execSync(`"${binPath}" --version`, { encoding: "utf8" })?.trim();
if (!versionOutput) {
return null;
}
Expand Down