title: Use 'request-promise-native' package in DialogFlow inline editor
body: <p>I am making a POST request to a webservice. The code for POST request is kept in a separate function.The function call from my intent function to the external function is asynchronous.So i am using Promises to achieve synchronicity.The problem here is that when i am importing <code>request-promise-native</code> inside my inline editor it's throwing error as <code>TypeError: Cannot read property 'prototype' of undefined</code>.</p>
  
  <p>But when i tried it in my local workstation which has node js version <code>9.11.1</code> it worked fine.The Node JS version in DialogFlow is <code>&gt;=6.0</code>.Is there any other dependency has to be added to it?</p>
  
  <p>Can anyone please explain why this happens?</p>
  
  <p>UPDATE:
  I changed the node engine to <code>6.14.3</code> and the dependency for the module'request-promise-native' in package.json as <code>"request-promise-native":"v1.0.5"</code>.But still no luck.The below is my code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var doco;
   var rp = require('request-promise-native');
   var myJSONObject = {
    "inputs" : [  {
      "name" : "&lt;name&gt;",
      "value" : &lt;value&gt;
    } ]
  };
  var orchName = 'TEST05';
    postData = JSON.stringify(myJSONObject);
   return networkCall(postData,orchName).then((response)=&gt;{
     console.log('response is'+response)            
               console.log("+++++++++++++=DOCO=+++++++++ "+response);
               doco = doco1;
               //agent.add(`Order number is ${doco1}`);
               
          }).catch((response) =&gt; {
        console.log(`ERROR: `+response);
      });
   
  console.log('doco'+doco); 
  
  function networkCall(postData, orchName) {
      return new Promise((resolve,reject) =&gt;{
        var options = {
    method: 'post',
    uri: '&lt;URL&gt;',
    body: myJSONObject,
    auth: {
          'user': 'usr',
          'pass': 'pwd'
        },
    json: true
  };
  return rp( options )
    .then( body =&gt; {
    // var test = JSON.stringify(body)
    var doco =body.ServiceRequest1.subforms.z_DOCO_137.value;
   console.log('DOCO '+doco);
      resolve( doco );
    })
    .catch( err =&gt; {
     console.log('FAILED'+err);
      reject( err );
    });
      });
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>The error is thrown once i deploy the code in inline editor.The error is:</p>
  
  <pre><code>The deployment of your Cloud Function failed:
  Function load error: Code in file index.js can't be loaded.
  Is there a syntax error in your code?
  Detailed stack trace: TypeError: Cannot read property 'prototype' of undefined
  at module.exports (/user_code/node_modules/request-promise-native/node_modules/request-promise-core/configure/request2.js:34:47)
  at Object.&lt;anonymous&gt; (/user_code/node_modules/request-promise-native/lib/rp.js:15:1)
  at Module._compile (module.js:577:32)
  at Object.Module._extensions..js (module.js:586:10)
  at Module.load (module.js:494:32)
  at tryModuleLoad (module.js:453:12)
  at Function.Module._load (module.js:445:3)
  at Module.require (module.js:504:17)
  at require (internal/module.js:20:19)
  at Object.&lt;anonymous&gt; (/user_code/index.js:17:23)
  </code></pre>