0

I'm writing a Cakefile that defines a task called build where the following line appears:

coffee.stderr.on 'data', (data) ->
    process.stderr.write.data.toString()

When I run the task with cake build, it throws a ReferenceError saying that the function toString is undefined.

I've tried repairing the Node installation, and re-installing CoffeeScript with npm.

John Flatness
  • 32,469
  • 5
  • 79
  • 81
Will
  • 4,241
  • 4
  • 39
  • 48

1 Answers1

1

I believe you want

process.stderr.write data.toString()

You've got an extra . in there.

The way you've written it is trying to call toString() on the data property of the write function. You're probably getting an error like Cannot call method 'toString' of undefined.

John Flatness
  • 32,469
  • 5
  • 79
  • 81