如何更正CoffeeScript蛋糕文件

如何更正CoffeeScript蛋糕文件,coffeescript,Coffeescript,以下CoffeeScript cakefile未显示任何输出: {exec} = require 'child_process' task 'watch', 'watch current directory and corrects the map file', (cb)-> console.log 'hello world' exec 'coffee -w -b -m -c .' ,(err,stdout,stderr) -> console.log

以下CoffeeScript cakefile未显示任何输出:

{exec} = require 'child_process'
task 'watch', 'watch current directory and corrects the map file', (cb)->
    console.log 'hello world'
    exec 'coffee -w -b -m -c .' ,(err,stdout,stderr) ->
        console.log err
        console.log stdout
        throw err if err
        console.log stdout + stderr

它正在编译所有文件,但当我在coffee文件中出错时,它不会抛出错误,也不会显示任何有关编译文件的信息。但是单独尝试exec命令时,确实会显示错误。

请尝试使用spawn而不是exec。我猜exec希望有缓冲区,但咖啡提供了一个流