1,320   JS NodeJS

var exec = require('child_process').exec; 
var nodeVersion = 'node -v';
exec(nodeVersion, function(err,stdout,stderr){
    if(err) {
        console.log('Get NodeJS Error:'+stderr);
    }else {
		var version = stdout;
        console.log("nodeVersion:"+version);
    }
});



Leave a Reply

Your email address will not be published. Required fields are marked *