File stream pause error in Watson Dialog service with Node.js
<p>I am trying to use the IBM Watson Dialog service with Node.js.</p>

<p>I'm following the API reference for Node.js here <a href="https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/dialog/api/v1/?node#" rel="nofollow">https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/dialog/api/v1/?node#</a></p>

<p>According to that, the way to create a dialog is this:</p>

<pre><code>var fs     = require('fs');
var watson = require('watson-developer-cloud');
var dialog_service = watson.dialog({
  username: '{username}',
  password: '{password}',
  version: 'v1'
});

var params = {
  name: 'my-dialog',
  file: fs.createFileStream('template.xml')
};

dialog_service.createDialog(params, function(err, dialog) {
  if (err)
    console.log(err)
  else
    console.log(dialog);
});
</code></pre>

<p>But the function fs.createFileStream doesn't exist so I used fs.createWriteStream with the same code.</p>

<p>But when I try to run that I get the following error</p>

<pre><code>/home/ubuntu/workspace/node_modules/watson-developer-cloud/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js:35
    source.pause();

TypeError: source.pause is not a function
    at Function.DelayedStream.create (/home/ubuntu/workspace/node_modules/watson-developer-cloud/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js:35:12)
    at FormData.CombinedStream.append (/home/ubuntu/workspace/node_modules/watson-developer-cloud/node_modules/request/node_modules/combined-stream/lib/combined_stream.js:43:37)
    at FormData.append (/home/ubuntu/workspace/node_modules/watson-developer-cloud/node_modules/request/node_modules/form-data/lib/form_data.js:46:3)
    at appendFormValue (/home/ubuntu/workspace/node_modules/watson-developer-cloud/node_modules/request/request.js:339:21)
    at Request.init (/home/ubuntu/workspace/node_modules/watson-developer-cloud/node_modules/request/request.js:350:11)
    at new Request (/home/ubuntu/workspace/node_modules/watson-developer-cloud/node_modules/request/request.js:140:8)
    at request (/home/ubuntu/workspace/node_modules/watson-developer-cloud/node_modules/request/index.js:55:10)
    at createRequest (/home/ubuntu/workspace/node_modules/watson-developer-cloud/lib/requestwrapper.js:131:10)
    at Dialog.createDialog (/home/ubuntu/workspace/node_modules/watson-developer-cloud/services/dialog/v1.js:192:10)
    at Object.&lt;anonymous&gt; (/home/ubuntu/workspace/dialog.js:15:16)
</code></pre>

<p>Any ideas why this pause function is not working? The error is shown on one of the modules from the watson-developer-cloud package so it is not part of my code.</p>