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.
This commit is contained in:
Marvin Zhang
2025-04-15 22:24:52 +08:00
parent e534a12a11
commit cfc5723c20

View File

@@ -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() {