ForbesLindesay / sync-request

Make synchronous web requests with cross platform support.
MIT License
326 stars 49 forks source link

asyncWrite is not a fn #101

Closed chenzeZzz closed 6 years ago

chenzeZzz commented 6 years ago

node: 8.9.4 sync-request: 3^

TypeError: asyncWrite is not a function
    at onwrite (/home/dev/backend/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:458:7)
    at WritableState.onwrite (/home/dev/backend/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:169:5)
    at ConcatStream._write (/home/dev/backend/node_modules/concat-stream/index.js:46:3)
    at doWrite (/home/dev/backend/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:406:64)
    at writeOrBuffer (/home/dev/backend/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:395:5)
    at ConcatStream.Writable.write (/home/dev/backend/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:322:11)
    at Socket.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)

    at doRequest (/home/dev/backend/node_modules/sync-request/index.js:27:11)

im not sure that its the issue of sync-request, but i found the code

var concat = require('concat-stream');

process.stdin.pipe(concat(function (stdin) {

}));

please

ForbesLindesay commented 6 years ago

I'm not able to reproduce this. Perhaps you could try upgrading to sync-request 6.0.0 or try the latest version of node.js