Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bot Service is not working with Node.js . Error cannot find module 'botbuilder'

I created a Bot Service through 'Azure Portal' with Node.js and LUIS. When the Bot is created, i can see the 'Chat interface' loading forever with a message 'Loading chat interface'. Bot developer interface

So I opened Bot through 'My bots' in 'dev.botframework.com' and tested the connection. It failed with the below error. Bot chat window

When i pinged 'Hi' in the chat box there, i could see the error in the logs 'Exception while executing function: Functions.messages. mscorlib: Error: Cannot find module 'botbuilder'

I could see 'botbuildr' dependency in 'package.json' as below.

{
  "name": "luisbot",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "dependencies": {
    "botbuilder": "^3.7.0",
    "botbuilder-azure": "3.0.2"
  },
  "devDependencies": {
      "restify": "^4.3.0"
  },  
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}

Any suggestions for the error?

like image 381
Babu Chaganti Avatar asked Apr 21 '17 05:04

Babu Chaganti


People also ask

How do I debug bot in Framework composer?

Choose a location to save the transcript file. Select the saved transcript ( ) icon to open the file in the Emulator. With your transcript file loaded, you're now ready to debug the interactions that you captured between a user and your bot. Select any event or activity from the conversation window on the left.

Which tool will you install to debug a bot using inspection middleware?

You can also Debug a bot using IDE or Debug with the Bot Framework Emulator, but to debug state you need to add inspection middleware to your bot. The Inspection bot samples are available for C#, JavaScript, Java, and Python.


1 Answers

I had this same problem and solved it by running npm install in kudu console.

Go to your Bot Service's Settings-tab and click to open "Advanced settings". There you can find "Advanced Tools" (kudu) under Development tools. Open Debug Console and cd to the folder where you have package.json (for me it was D:\home\site\wwwroot\messages) and run npm install.

After that you can communicate with the bot in dev.botframework.com although the chat interface won't still work in Azure portal.

like image 192
Henri Hietala Avatar answered Sep 22 '22 14:09

Henri Hietala