Start a new topic

Kinvey.execute - TypeError Kinvey.execute is not a function

I'm attempting to invoke an endpoint via the node.js SDK.  My code is copied from the example:


  

Kinvey.init({
  appKey: '____________',
  appSecret: '_______________________'
});

var p = Kinvey.execute(':endpoint', {
  name: 'Fred Jones',
  eyes: 'Blue'
}, {
  success: function(response) {
    console.log(response);
  }
});

  

And it immediately throws the following error:


var p = Kinvey.execute(':endpoint', {

               ^


TypeError: Kinvey.execute is not a function

    at Object.<anonymous> (/Users/damianesteban/Code/javascript/vstar-node/vstar-express/app.js:42:16)

    at Module._compile (module.js:541:32)

    at Object.Module._extensions..js (module.js:550:10)

    at Module.load (module.js:458:32)

    at tryModuleLoad (module.js:417:12)

    at Function.Module._load (module.js:409:3)

    at Function.Module.runMain (module.js:575:10)

    at startup (node.js:160:18)

    at node.js:449:3


However this code below is executed fine:


const p = Kinvey.ping();
p.then((res) => {
  console.log(`Hello Kinvey! Kinvey Info: ${res.version} / ${res.kinvey}`);
})
.catch((err) => {
  console.log(`Kinvey error: ${err}`);
})

Has anyone else faced this issue?




I got it working.  Just so you're aware, npm gives the message that v1.6.8 is deprecated.


Thank you.

Hi Damian,


Can you please install Kinvey SDK as stated in the Getting Started guide: http://devcenter.kinvey.com/nodejs/guides/getting-started ?


I am able to do npm install, and then execute endpoints successfully after user login. The latest stable version is v1.6.8, as Kinvey v3 SDK is still in beta mode.



Regards,

Wani

Any word on this?  My company has been using Kinvey for several months to develop an application and this is one of the last things we need to finish.  Thank you.

I'm using the latest version of the node.js SDK - https://github.com/Kinvey/kinvey-nodejs.

Hi,


Can you share the SDK version you are trying out? If you are not using the latest SDK version, can you try above code with the latest version of the SDK and see if the problem has already been fixed?



Regards.

Wani

Kinvey Support

Login or Signup to post a comment