Skip to content

Commit 26e0294

Browse files
committed
fix(mcp-server): guard execNpm npm_execpath with existsSync
Fall back to plain npm when npm_execpath is set but the file is missing, matching spawnNpx behavior.
1 parent 8dd5af4 commit 26e0294

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mcp-server/test/npm-exec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function execNpm(
99
args: string[],
1010
options: Parameters<typeof execFileSync>[2]
1111
) {
12-
if (npmCli) {
12+
if (npmCli && existsSync(npmCli)) {
1313
return execFileSync(process.execPath, [npmCli, ...args], options);
1414
}
1515
return execFileSync("npm", args, options);

0 commit comments

Comments
 (0)