node.js - Node Child Process Exec Command Failed with error code 1 -


i trying execute line using node js child process , getting error. following code:

let cmd : string = "code " + projects[value]; exec(cmd, function callback(error, stdout, stderr) {   console.log("started console app"); }); 

error :

cmd:"c:\windows\system32\cmd.exe /s /c "code c:\users\shana\dropbox\code-settings-syn... (length: 82)" code:1 killed:false message:"command failed: c:\windows\system32\cmd.exe /s /c "code c:\users\shana\dropbox\c... (length: 99)" signal:null stack:undefined 

detail of error json.

full cmd : "c:\windows\system32\cmd.exe /s /c "code c:\users\shana\dropbox\code-settings-sync"" full message : "command failed: c:\windows\system32\cmd.exe /s /c "code c:\users\shana\dropbox\code-settings-sync"\n" 

try simpler example ..

var exec = require('child_process').exec; var cmd = 'code c:\program files'; exec(cmd, function(err, stdout, stderr) { if (err) { console.error(err); return; } console.log(stdout);  }); 

does work??


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -