pg-copy-streams is failing to create query object. var stream = con.query(copyTo('COPY my_table TO STDOUT')); The code fails with following error: query._result._getTypeParser = this._types.getTypeParser.bind(this._types) ^ TypeError: Cannot set property '_getTypeParser' of undefined