Javascript 如何在成功完成作业后在ssh2 nodejs中返回JSON响应

Javascript 如何在成功完成作业后在ssh2 nodejs中返回JSON响应,javascript,ecmascript-6,google-assistant-sdk,dialogflow-es-fulfillment,jovo-framework,Javascript,Ecmascript 6,Google Assistant Sdk,Dialogflow Es Fulfillment,Jovo Framework,我想在远程服务器上执行一些任务。但我没有得到有效的JSON响应。我尝试了各种方法来获得丰富的JSON响应,但它不起作用 这是Google的意图,我只想通过Google Assistant在远程服务器上部署: async DoDeployIntent(){ const status=wait doFullDeploy(); 控制台日志(状态); 这个。告诉(状态); } //这里是ssh连接 ssh.connect({ 主持人:“35.239.181.109”, 港口:22, 用户名:'commo

我想在远程服务器上执行一些任务。但我没有得到有效的JSON响应。我尝试了各种方法来获得丰富的JSON响应,但它不起作用

这是Google的意图,我只想通过Google Assistant在远程服务器上部署:

async DoDeployIntent(){
const status=wait doFullDeploy();
控制台日志(状态);
这个。告诉(状态);
}
//这里是ssh连接
ssh.connect({
主持人:“35.239.181.109”,
港口:22,
用户名:'common_dkumar',
密码短语:“12345”,
私钥:'./ssh/id\u rsa'
});
//以下是异步函数:
const doFullDeploy=async()=>{
返回JSON.stringify(ssh.execCommand('sudophpbin/magentos:up',{cwd:'/var/www/html'}){
if(result.stdout){
返回JSON.stringify('Deploy Success');
}
if(result.stderr){
返回JSON.stringify('Deploy Failed');
}
}))
}
我的问题是,对于任务完成或失败,我没有得到有效的JSON丰富响应。我还尝试了以下操作,但没有得到有效的JSON响应

constdofulldeploy=async()=>{
var Client=require('ssh2')。Client;
var conn=新客户端();
返回连接on('ready',函数(){
conn.exec('sudophp/var/www/html/bin/magento-deploy:mode:show',函数(err,stream){
返回JSON.stringify('Maintence Mode Enable Failed');
});
}).连接({
主持人:“35.239.181.109”,
港口:22,
用户名:'common_dkumar',
密码短语:“12345”,
privateKey:require('fs').readFileSync('./ssh/id_rsa'))
});
}
数字流错误:

Failed to parse Dialogflow response into AppResponse because of
invalid platform response: Could not find a RichResponse or
SystemIntent in the platform response for agentId:
54e79a5d-97f9-49f4-981d-da0528d9e8fa and intentId:
181fa007-e5b8-4866-b8ca-6fbcb53c4f6b. WebhookStatus: message: "Webhook
execution successful" .

Dialogflow在您的代码中的什么位置?@NickFelker代码在google计算函数中,您在上面的代码中与Dialogflow交互的位置?@NickFelker我只需要doFullDeploy()方法返回响应json,我没有得到。您只是返回一个字符串?