Node.js 无法使用jenkins触发基于NodeJS的批处理/Exe文件
我试图通过NodeJS脚本使用以下命令执行my batch/exe文件:Node.js 无法使用jenkins触发基于NodeJS的批处理/Exe文件,node.js,jenkins,jasmine,protractor,Node.js,Jenkins,Jasmine,Protractor,我试图通过NodeJS脚本使用以下命令执行my batch/exe文件: var child_process = require('child_process'); i.e. child_process.execFile For exe child_process.exec For Batch file 当我尝试使用以下两种方法执行脚本时: 通过CMD触发将成功执行 通过Jenkins触发,它不会执行 在这两种情况下,目录是相同的 为此,我一直在使用以下功能: exports.exec_e
var child_process = require('child_process');
i.e.
child_process.execFile For exe
child_process.exec For Batch file
当我尝试使用以下两种方法执行脚本时:
exports.exec_exe_file = exec_exe_file = function(exe)
//child_process.execFile(exe, function(error, stderr, stdout) {
child_process.exec(exe, function(error, stderr, stdout) { if (error) {
console.error('stderr', stderr); throw error; } //console.log('stdout',
stdout); });
}
称为:
var autoit = __dirname + "\\autoit\\start_AutoitExe.bat";
//var autoit = __dirname + '\\autoit\\Script.exe';
exec_exe_file(autoit);
显示您在问题中尝试的代码。@yong请查看我更新的问题。您是如何在jenkins中配置以运行它的?给出jenkins作业配置关键部分的屏幕截图。@yong请查看屏幕截图:顺便说一句,我不这么认为,jenkins配置中存在此项的问题。