diff --git a/src/index.ts b/src/index.ts index 5bd41a65..99cf5f19 100644 --- a/src/index.ts +++ b/src/index.ts @@ -107,10 +107,16 @@ async function isCLIInstalled(path: string) { return true } catch (error) { // check of the cli is installed globally - const output = execSync('npm ls -g', { encoding: 'utf-8' }) - if (output.includes('@wdio/cli')) { - return true + // wrap in try/catch as it can fail on Windows + try { + const output = execSync('npm ls -g', { encoding: 'utf-8' }) + if (output.includes('@wdio/cli')) { + return true + } + } catch (err) { + return false } + return false } -} \ No newline at end of file +}