I have the following npm script i want to convert to gulp task
"scripts": {
"lint": "eslint .",
"start": "npm run build:sdk && node .",
"posttest": "npm run lint && nsp check",
"build:sdk": "./node_modules/.bin/lb-sdk server/server.js ./client/src/app/shared/sdk"
},
Now i want a gulp task to have the same functionality as npm start . but i am not able to club the tasks as it will run the npm run build:sdk and then node .
Here is what i have done so far .
gulp.task('default', function() {
gulp.run('sdk');
gulp.run('server');
gulp.watch(['./common/models/*.js'], function() {
gulp.run('server');
});
});
gulp.task('server', function() {
if (node) node.kill();
node = spawn('node', ['server/server.js'], {stdio: 'inherit'});
node.on('close', function(code) {
if (code === 8) {
gulp.log('Error detected, waiting for changes...');
}
});
});
gulp.task('sdk', function() {
spawn('./node_modules/.bin/lb-sdk server/server.js ./client/src/app/shared/sdk');
});
Stack trace
Error: spawn ./node_modules/.bin/lb-sdk server/server.js ./client/src/app/shared/sdk ENOENT
at exports._errnoException (util.js:1050:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:367:16)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
at Module.runMain (module.js:607:11)
at run (bootstrap_node.js:423:7)
at startup (bootstrap_node.js:147:9)
at bootstrap_node.js:538:3