From cfc5723c2027291684827844e802ca76f24081ff Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Tue, 15 Apr 2025 22:24:52 +0800 Subject: [PATCH] fix: correct PATH environment variable configuration in task runner - Updated the configureNodePath method to properly set the PATH environment variable by concatenating node_bin and node_modules paths, ensuring the correct environment setup for Node.js development. --- core/task/handler/runner.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/task/handler/runner.go b/core/task/handler/runner.go index 9baf7574..b6ca0850 100644 --- a/core/task/handler/runner.go +++ b/core/task/handler/runner.go @@ -361,15 +361,17 @@ func (r *Runner) configureNodePath() { // Configure global node_modules path nodePath := utils.GetNodeModulesPath() if !strings.Contains(envPath, nodePath) { - _ = os.Setenv("PATH", nodePath+":"+envPath) + envPath = nodePath + ":" + envPath } _ = os.Setenv("NODE_PATH", nodePath) // Configure global node_bin path nodeBinPath := utils.GetNodeBinPath() if !strings.Contains(envPath, nodeBinPath) { - _ = os.Setenv("PATH", nodeBinPath+":"+envPath) + envPath = nodeBinPath + ":" + envPath } + + _ = os.Setenv("PATH", envPath) } func (r *Runner) configureGoPath() {