升级预装node.js

This commit is contained in:
marvzhang
2020-04-21 12:54:02 +08:00
parent 63546637c9
commit 730349e28e
2 changed files with 6 additions and 6 deletions

View File

@@ -115,7 +115,7 @@ func SetEnv(cmd *exec.Cmd, envs []model.Env, task model.Task, spider model.Spide
// 默认把Node.js的全局node_modules加入环境变量
envPath := os.Getenv("PATH")
homePath := os.Getenv("HOME")
nodeVersion := "v8.12.0"
nodeVersion := "v10.19.0"
nodePath := path.Join(homePath, ".nvm/versions/node", nodeVersion, "lib/node_modules")
if !strings.Contains(envPath, nodePath) {
_ = os.Setenv("PATH", nodePath+":"+envPath)