I'm following the official quick start of Microsoft Bot Builder(SDK v3) for NodeJs: Create a bot with the Bot Builder SDK for Node.js
1- I made a new project with
npm init
2- then
npm install --save botbuilder
3- then I created a new file "app.js"
var builder = require('botbuilder');
var connector = new builder.ConsoleConnector().listen();
var bot = new builder.UniversalBot(connector, function (session) {
session.send("You said: %s", session.message.text);
});
But when I run "node app.js" the following error is thrown:
var connector = new builder.ConsoleConnector().listen();
^
TypeError: builder.ConsoleConnector is not a constructor
Could anyone help me, please?
My project structure:
There is a mismatch between the documentation and the latest release of the botbuilder package (version 4.0.6) features / methods. Microsoft has changed some of the legacy features of the botbuilder npm package, but they haven't updated their doc yet!
The JavaScript code which is present in Microsoft's Documentation won't work for the same reason!
Try with the botbuilder package version 3.13.1 , it will work perfectly.
To Install:
npm i -S [email protected]
And your piece of code will work!
Find the snapshots:
Cheers!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With