在Windows中,Exec等效于使用子进程运行gulp任务

时间:2017-05-05 08:58:26

标签: javascript node.js shell gulp

我试图在Windows中执行gulp任务,但它不起作用。它可以在Linux中运行。

var exec = require('child_process').exec;

gulp.task('lodash', function (callback) {
   exec('node_modules/lodash-cli/bin/lodash -o ./tmp/lodash.custom.js include=' + lodashIncludes.join(','), callback);
});

错误讯息:

'node_modules' not recognized as an internal or external module, 
an executable program or command file
    at ChildProcess.exithandler (child_process.js:204:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:886:16)
    at Socket.<anonymous> (internal/child_process.js:342:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:501:12)

0 个答案:

没有答案