Skip to content

Commit 2619fce

Browse files
committed
fix: set path variables when trying to run npm commands
1 parent 17d1fca commit 2619fce

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Editor/Utils/McpUtils.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,11 @@ public static void RunNpmCommand(string arguments, string workingDirectory)
336336
CreateNoWindow = true
337337
};
338338

339+
// Patch: Ensure PATH includes common npm locations and current PATH
340+
string currentPath = Environment.GetEnvironmentVariable("PATH") ?? string.Empty;
341+
string extraPaths = "/usr/local/bin:/opt/homebrew/bin";
342+
startInfo.EnvironmentVariables["PATH"] = $"{extraPaths}:{currentPath}";
343+
339344
if (useCustomNpmPath)
340345
{
341346
// Use the custom path directly

0 commit comments

Comments
 (0)