Skip to content
Advertisement

Tag: nodejs-stream

stream.write This expression is not callable

I am trying to a write a function that takes either writeable stream (createWriteStream) or process.stdout/.stderr but typescript keeps throwing this error. Error goes away when I do conditional type check. Error message at line 3 Answer Both NodeJS.WriteStream and WriteStream overload the write() method, but they use different signatures, resulting in the error you are seeing. Instead of defining

Advertisement