diff --git a/packages/cli/src/commands/pip/cmd-pip.mts b/packages/cli/src/commands/pip/cmd-pip.mts index c08072a3c..4ad111c92 100644 --- a/packages/cli/src/commands/pip/cmd-pip.mts +++ b/packages/cli/src/commands/pip/cmd-pip.mts @@ -28,6 +28,7 @@ import { WIN32 } from '@socketsecurity/lib-internal/constants/platform' import { spawn } from '@socketsecurity/lib-internal/spawn' import { commonFlags } from '../../flags.mts' +import { spawnNode } from '../../utils/spawn/spawn-node.mts' import { meowOrExit } from '../../utils/cli/with-subcommands.mjs' import { resolveSfw } from '../../utils/dlx/resolve-binary.mjs' import { filterFlags } from '../../utils/process/cmd.mts' @@ -108,7 +109,7 @@ async function run( // Use local sfw if available, otherwise use pnpm dlx. const result = resolution.type === 'local' - ? await spawn('node', [resolution.path, 'pip', ...argsToForward], { + ? await spawnNode([resolution.path, 'pip', ...argsToForward], { shell: WIN32, stdio: 'inherit', }) diff --git a/packages/cli/src/utils/dlx/spawn.mts b/packages/cli/src/utils/dlx/spawn.mts index b66a7638d..b8b5ae65c 100644 --- a/packages/cli/src/utils/dlx/spawn.mts +++ b/packages/cli/src/utils/dlx/spawn.mts @@ -16,9 +16,9 @@ import { SOCKET_PUBLIC_API_TOKEN } from '@socketsecurity/lib/constants/socket' import { dlxPackage } from '@socketsecurity/lib/dlx-package' -import { spawn } from '@socketsecurity/lib/spawn' import { resolveCdxgen, resolveCoana } from './resolve-binary.mjs' +import { spawnNode } from '../spawn/spawn-node.mts' import { getDefaultOrgSlug } from '../../commands/ci/fetch-default-org-slug.mjs' import ENV from '../../constants/env.mts' import { @@ -133,7 +133,7 @@ export async function spawnCoanaDlx( ...mixinsEnv, ...spawnEnv, } - const spawnResult = await spawn('node', [resolution.path, ...args], { + const spawnResult = await spawnNode([resolution.path, ...args], { cwd: dlxOptions.cwd, env: finalEnv, stdio: spawnExtra?.['stdio'] || 'inherit', @@ -202,7 +202,7 @@ export async function spawnCdxgenDlx( ...options, } as DlxOptions - const spawnResult = spawn('node', [resolution.path, ...args], { + const spawnResult = spawnNode([resolution.path, ...args], { cwd: dlxOptions.cwd, env: { ...process.env, diff --git a/packages/cli/src/utils/python/standalone.mts b/packages/cli/src/utils/python/standalone.mts index 355fbfe42..927ce381e 100644 --- a/packages/cli/src/utils/python/standalone.mts +++ b/packages/cli/src/utils/python/standalone.mts @@ -56,6 +56,7 @@ import ENV from '../../constants/env.mts' import { PYTHON_MIN_VERSION } from '../../constants/packages.mts' import { resolvePyCli } from '../dlx/resolve-binary.mjs' import { getErrorCause, InputError } from '../error/errors.mts' +import { spawnNode } from '../spawn/spawn-node.mts' import type { CResult } from '../../types.mjs' @@ -388,7 +389,7 @@ export async function spawnSocketPython( // Use local Python CLI if available. if (resolution.type === 'local') { - const spawnResult = await spawn('node', [resolution.path, ...args], { + const spawnResult = await spawnNode([resolution.path, ...args], { cwd: options?.cwd, env: finalEnv, shell: WIN32,