Will
Will

Reputation: 4621

Cakefile not seeing JS functions

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.

Upvotes: 0

Views: 113

Answers (1)

John Flatness
John Flatness

Reputation: 33769

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.

Upvotes: 1

Related Questions