I\'m currently trying to run process using spawn
. What I am trying to run from shell is the following;
NODE_ENV=production node app/app.js
add shell option worked for me
gulp.task('xxx', function (callback) {
process.chdir('xxx/');
var spawn = require('child_process').spawn;
var productionEnv = Object.create(process.env);
// var jekyll = spawn('gulp', ['stylecheck'], {stdio: 'inherit', env: productionEnv});
var jekyll = spawn('gulp', ['stylecheck'], {stdio: 'inherit', env: productionEnv, shell: true});
jekyll.on('exit', function (code) {
console.log(arguments);
});
});