Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit e71a16f

Browse files
hide npm ls error
1 parent 21f1632 commit e71a16f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import fs from 'node:fs/promises'
22
import path from 'node:path'
33
import { pathToFileURL } from 'node:url'
4+
import { execSync } from 'node:child_process'
45

56
import chalk from 'chalk'
67
import semver from 'semver'
@@ -13,7 +14,6 @@ import {
1314
INSTALL_COMMAND, DEV_FLAG, PMs, EXECUTER,EXECUTE_COMMAND
1415
} from './constants.js'
1516
import type { ProgramOpts } from './types'
16-
import { execSync } from 'node:child_process'
1717

1818
const WDIO_COMMAND = 'wdio'
1919
let projectDir: string | undefined
@@ -109,7 +109,10 @@ async function isCLIInstalled(path: string) {
109109
// check of the cli is installed globally
110110
// wrap in try/catch as it can fail on Windows
111111
try {
112-
const output = execSync('npm ls -g', { encoding: 'utf-8' })
112+
const output = execSync('npm ls -g', {
113+
encoding: 'utf-8',
114+
stdio: ['ignore', 'pipe', 'ignore']
115+
})
113116
if (output.includes('@wdio/cli')) {
114117
return true
115118
}

0 commit comments

Comments
 (0)