totorojs/totoro

内部gitlab-ci上安装totoro运行后出错,可能和系统有关

jserme opened this issue · 1 comments

buffer.js:434
throw new Error('Unknown encoding');
^
Error: Unknown encoding
at Buffer.toString (buffer.js:434:13)
at Object.fs.readFileSync (fs.js:236:33)
at findRunnerRoot (/home/admin/gitlab-ci-runner/tmp/builds/project-47/node_modules/totoro/lib/handle-cfg.js:113:22)
at handleClientRoot (/home/admin/gitlab-ci-runner/tmp/builds/project-47/node_modules/totoro/lib/handle-cfg.js:74:26)
at handleCfg (/home/admin/gitlab-ci-runner/tmp/builds/project-47/node_modules/totoro/lib/handle-cfg.js:38:5)
at new Client (/home/admin/gitlab-ci-runner/tmp/builds/project-47/node_modules/totoro/lib/index.js:23:16)
at Object. (/home/admin/gitlab-ci-runner/tmp/builds/project-47/node_modules/totoro/bin/totoro:78:23)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)

知道原因了,gitlab-ci上每一条命令执行的时候都会重新加载环境变量

在运行totoro的时候用nvm指定使用的node版本就行了

nvm use 0.10 && ./node_modules/totoro/bin/totoro