Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
152
rated 0 times [  155] [ 3]  / answers: 1 / hits: 21679  / 12 Years ago, thu, july 26, 2012, 12:00:00

I'm creating an automated web app build process with node.js on windows. I'm trying to run our code through Google closure java program. I read the documentation on child_process in the node documents. It mentions it doesnt work in windows yet. Is there a package or work around for this?



Heres the code im trying to run.



var _exec = require('child_process').exec;
_exec( 'java ' + '-jar '+ COMPILER_JAR +' --js '+ srcPath +' --js_output_file '+ distPath,
function(e){
echo( google closure done....);
echo( e );
} );

More From » node.js

 Answers
21

I have a web server app for controlling a queue of builds on windows XP and I used it to run batch files or executables without any additional packages.



I would check the error parameter on the callback and stderr as this may help you find the reason it does not work.



My example solution out of my server which I hope helps:



var theJobType = 'FOO';
var exec = require('child_process').exec;
var child = exec('Test.exe ' + theJobType, function( error, stdout, stderr)
{
if ( error != null ) {
console.log(stderr);
// error handling & exit
}

// normal

});

[#84034] Tuesday, July 24, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
alfredoc

Total Points: 261
Total Questions: 128
Total Answers: 89

Location: French Polynesia
Member since Sun, Aug 2, 2020
4 Years ago
;