我试图从nodejs服务器上运行Azure Webapp上的exe文件。该exe文件由PyInstaller由简单的python文件创建。未能在Azure Webapp上运行EXE文件
var exec = require('child_process').exec;
let cmd = 'hello.exe';
let child = exec(
cmd, {
cwd: path_to_exe_file
},
function(error, stdout, stderr) {
if (error === null) {
res.render('index', { title: stdout });
} else {
console.log(error);
res.json({
'status': '400',
'res': error
});
}
}
);
工作一切良好,我的机器上,但是当我部署到Azure的web应用原来的错误:应用程序未能启动, 因为它并排并排配置不正确
Error: Command failed: hello.exe The application has failed to start
because its side-by-side configuration is incorrect.
Please see the application event log or use the command-line sxstrace.exe
tool for more detail.
at ChildProcess.exithandler (child_process.js:206:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) killed: false, code: 1, signal: null, cmd: 'hello.exe' }
我该如何解决这个问题?谢谢
由于不太确切,Azure Web App包含python运行时,您仍然可以在Azure Web Apps上的node.js脚本中执行python脚本。这个问题应该归功于任何C++依赖关系'pyinstaller'的使用。因为我们没有权限处理Azure Web App上的C++组件。所以,如果可能的话,你可以尝试直接执行python脚本吗? –
是的,由于pyinstaller的问题。 .Net exe文件怎么样,我可以在Azure Web Apps的nodejs脚本中运行.Net exe文件吗? –