Skip to content

Commit bf2310a

Browse files
committed
fix: No such file or directory(#393, #196)
Signed-off-by: sunrabbit123 <[email protected]>
1 parent 1317767 commit bf2310a

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/client/cross-spawn.test.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ describe("StdioClientTransport using cross-spawn", () => {
7272
"test-command",
7373
[],
7474
expect.objectContaining({
75-
env: customEnv
75+
env: {
76+
PATH: process.env.PATH,
77+
...customEnv,
78+
}
7679
})
7780
);
7881
});

src/client/stdio.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ export class StdioClientTransport implements Transport {
117117
this._serverParams.command,
118118
this._serverParams.args ?? [],
119119
{
120-
env: this._serverParams.env ?? getDefaultEnvironment(),
120+
env: {
121+
PATH: process.env.PATH,
122+
...this._serverParams.env ?? getDefaultEnvironment(),
123+
},
121124
stdio: ["pipe", "pipe", this._serverParams.stderr ?? "inherit"],
122125
shell: false,
123126
signal: this._abortController.signal,

0 commit comments

Comments
 (0)