Closed SUPRIYO05 closed 5 years ago
@SUPRIYO05 can you provide a little more detail & context. The issue title is not clear.
We do have a number of selenium java bots residing on machine. They need to be submitted based on intent occurence. Looking for options to execute them. Know that exposing as rest api can be an option but presently its not viable.
@SUPRIYO05 , for sure you can execute bash-commands in node-apps. E.g. check https://stackoverflow.com/questions/37732331/execute-bash-command-in-node-js-and-get-exit-code
I tried to use the following code in botpress( code kept in path '..\Botpress\data\global\actions'.
var sys = require('sys')
var exec = require('child_process').exec;
function puts(error, stdout, stderr) { sys.puts(stdout) }
exec("ls -la", function(err, stdout, stderr) {
console.log(stdout);
Error: err:Module "sys" not found. Tried these locations: "..\Botpress\data\global\actions"
@SUPRIYO05 , you aren't using neither puts
function nor sys
module. Did you try to remove them from code-snippet? I don't think this is botpress-related issue.
Thanks All for your suggestions. Still I get some issues
Code: var bat_exec = require('child_process').exec; exec("ls -la", function(err, stdout, stderr) { console.log(stdout); });
I am getting error in first line:
err:Module "child_process" not found. Tried these locations: "...Documents\Botpress\data\global\actions"
@SUPRIYO05 , child_process is builtin node module. So this could be an issue with node set up on your side.
Thanks! any help please?
I have opened one more issue in node Js forum, but if any one has experienced this earlier. My version of node JS is 10.15.0
Just now I built a code as below in NODE.JS
/ Hello, World! program in node.js / console.log("Hello, World!") var bat_exec = require('child_process').exec; bat_spawn("dir", function(err, stdout, stderr) { console.log(stdout); });
It worked perfectly fine and displayed output.
Path from where executed: "...Documents\train_nodJS"
My point is why when executed from BOT press its only checking in ""...Documents\Botpress\data\global\actions" path. Why its not looking for system default? Bot the above paths are under same hiererchy?
Also these scripts called for actions, are they node.JS or Javascript? Sorry I am a core ERP guy and now trying to get into these domains.
Regards
Supriyo
Anyone any thoughts please?
Make sure these checkboxes are checked before raising an issue, thank you!
8.9
Please also fill in these fields:
Botpress version:
<<VERSION HERE>>
Channels: <
>