Skip to content

Commit

Permalink
fix: handle spaces in node bin path (#711)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiand391 authored Nov 10, 2023
1 parent 76ea070 commit 0e5f43e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ export async function findNode(root: string): Promise<string> {

// 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
Expand Down

0 comments on commit 0e5f43e

Please sign in to comment.