diff --git a/src/cli/commands/monitor/index.ts b/src/cli/commands/monitor/index.ts index 6e16b3cc7e..4a60e28729 100644 --- a/src/cli/commands/monitor/index.ts +++ b/src/cli/commands/monitor/index.ts @@ -159,7 +159,15 @@ export default async function monitor(...args0: MethodArgs): Promise { ); } - const hasPnpmSupport = await hasFeatureFlag(PNPM_FEATURE_FLAG, options); + let hasPnpmSupport = false; + try { + hasPnpmSupport = (await hasFeatureFlag( + PNPM_FEATURE_FLAG, + options, + )) as boolean; + } catch (err) { + hasPnpmSupport = false; + } const featureFlags = hasPnpmSupport ? new Set([PNPM_FEATURE_FLAG]) diff --git a/src/lib/snyk-test/index.js b/src/lib/snyk-test/index.js index aa0148c25a..ac8840f698 100644 --- a/src/lib/snyk-test/index.js +++ b/src/lib/snyk-test/index.js @@ -29,9 +29,13 @@ async function test(root, options, callback) { } async function executeTest(root, options) { + let hasPnpmSupport = false; + try { + hasPnpmSupport = await hasFeatureFlag(PNPM_FEATURE_FLAG, options); + } catch (err) { + hasPnpmSupport = false; + } try { - const hasPnpmSupport = await hasFeatureFlag(PNPM_FEATURE_FLAG, options); - const featureFlags = hasPnpmSupport ? new Set([PNPM_FEATURE_FLAG]) : new Set([]);