From a0056062cfd7fb10c831ae4e27ed2595229e25a4 Mon Sep 17 00:00:00 2001 From: Cristian Dominguez Date: Fri, 10 Nov 2023 17:01:52 -0300 Subject: [PATCH] fix: handle spaces in node bin path --- src/util.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util.ts b/src/util.ts index fec5e969..3fe51263 100644 --- a/src/util.ts +++ b/src/util.ts @@ -73,7 +73,10 @@ export async function findNode(root: string): Promise { // Check to see if node is installed const nodeShellString = shelljs.which('node') - if (nodeShellString?.code === 0 && nodeShellString?.stdout) return nodeShellString.stdout + if (nodeShellString?.code === 0 && nodeShellString?.stdout) { + // wrap node path in double quotes to deal with spaces + return `"${nodeShellString.stdout}"` + } const err = new Error('Cannot locate node executable.') // eslint-disable-next-line @typescript-eslint/ban-ts-comment