Getting error while Starting BotKit app.js

Hi Team,

Recently i have configured BOTKit for webhook integration as per the documentation. But getting below error while starting the server.

D:\Kore.ai\BotKit>node app.js
internal/modules/cjs/loader.js:796
throw err;
^

Error: Cannot find module ‘url-template’
Require stack:

  • D:\Kore.ai\BotKit\LiveChatAPI.js
  • D:\Kore.ai\BotKit\LiveChat.js
  • D:\Kore.ai\BotKit\lib\app\routes.js
  • D:\Kore.ai\BotKit\lib\app\index.js
  • D:\Kore.ai\BotKit\app.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17)
    at Function.Module._load (internal/modules/cjs/loader.js:686:27)
    at Module.require (internal/modules/cjs/loader.js:848:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (D:\Kore.ai\BotKit\LiveChatAPI.js:6:16)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions…js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Module.require (internal/modules/cjs/loader.js:848:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (D:\Kore.ai\BotKit\LiveChat.js:7:27)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions…js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Module.require (internal/modules/cjs/loader.js:848:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (D:\Kore.ai\BotKit\lib\app\routes.js:4:22)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions…js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Module.require (internal/modules/cjs/loader.js:848:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (D:\Kore.ai\BotKit\lib\app\index.js:5:24)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions…js (internal/modules/cjs/loader.js:991:10) {
    code: ‘MODULE_NOT_FOUND’,
    requireStack: [
    ‘D:\Kore.ai\BotKit\LiveChatAPI.js’,
    ‘D:\Kore.ai\BotKit\LiveChat.js’,
    ‘D:\Kore.ai\BotKit\lib\app\routes.js’,
    ‘D:\Kore.ai\BotKit\lib\app\index.js’,
    ‘D:\Kore.ai\BotKit\app.js’
    ]
    }

D:\Kore.ai\BotKit>

Best Regards,

Sujan

Hi Team,

Issue has been solved by installing modules.

npm install url-template
npm install node-schedule

Best Regards,

Sujan

@sujan.cybermak good to know that. We also mention the same in our documentation of https://developer.kore.ai/docs/bots/sdks/botkit-sdk-tutorial-agent-transfer/

Note : Make sure url-template and node-schedule modules (and any other modules as referenced in js file related to LiveChat) are installed on your computer.

@sujan.cybermak,
If you are not using botkit to connect to agent software, you could just remove the reference from app.js file of Botkit and the developer will not asked to install these modules.
image

We were relying on these modules to schedule jobs and construct URL at LiveChat.js file.

There is also a dependency for this module as LiveChat.js is referenced at **/lib/app/routes.js. Comment the below lines of code at routes.js file as needed

var livechat       = require("../../LiveChat.js");
app.get( apiPrefix + '/gethistory', livechat.gethistory);

Hi,

I am trying this integration for Kore.ai sample flight search bot with the help of https://developer.kore.ai/docs/bots/sdks/kore-ai-botkit-sdk-tutorial/ . I followed step by step process and for me everything is running but when I am talking to the bot then getting no response.

Can somebody please help me if you also have come across the similar problem.

Thanks and regards,

Hi @poonam,

Is your botKit up and running?
Are you observing any errors in the commands prompt?

Please let us know the above details.

Regards,
Yoga Ramya