diff --git a/src/utils.ts b/src/utils.ts index e0998ac8d..eda0c8cde 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -167,9 +167,11 @@ async function findNodeViaShell(vscode: vscodeTypes.VSCode): Promise(resolve => { const startToken = '___START_PW_SHELL__'; const endToken = '___END_PW_SHELL__'; + const cwd = vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders[0] : undefined; const childProcess = spawn(`${vscode.env.shell} -i -c 'echo ${startToken} && which node && echo ${endToken}'`, { stdio: 'pipe', - shell: true + shell: true, + cwd, }); let output = ''; childProcess.stdout.on('data', data => output += data.toString());