Microsoft bot framework includes Bot Builder tools which help in bot development. Bot Builder is an open-source SDK. It supports .NET, Node.js, and REST. The Bot Builder SDK for Node.js uses Express & Restify frameworks. In this article, we are going to develop a chatbot on NodeJs platform.
Prerequisite
- Node.js installation.
- Visual Studio Code installation
- Download Bot Framework Emulator. The emulator is a desktop application that lets you test a bot application on localhost or running remotely.
After installation, open Node.js command prompt (run as administrator). Create a folder for bot files (I have created folder ChatBot_NodeJs) and navigate to that path in command prompt.
Run command npm init. This command will ask a set of questions and create package.json with the options entered. If command is invoked with -f, --force, -y, or --yes, it will use defaults and will not prompt for options.

Here, I have entered the bot name as order_your_grocery. The starting js file for the application will be starter.js. After entering all details, it will print content for package.json and will ask for confirmation. After we confirm with yes, it will create the file and save it to the folder.
Run the following command to install Bot Builder SDK.
- npm install --save botbuilder
Run the following command to install restify framework.
- npm install --save restify
Now, open bot folder in Visual Studio code and create a JavaScript file in this folder with name starter.js and start coding in this file.
Node.js follows CommonJS module system. To include modules in different files, the require function can be used. Require function reads and executes JavaScript file, and return the exports object. We will load restify and botbuilder modules using this require function.
- var restify = require('restify');
- var builder = require('botbuilder');
Run the following command to install Restify framework.
- npm install --save restify
Now, open bot folder in Visual Studio code and create JavaScript file in this folder with name starter.js. And start coding in this file.

Rohan RaoPosted Apr 22, 2020, 12:09 AM
Hey Akshay, nice tutorial! When I am running this command node starter.js it gives me error: " builder.ChatConnector is not a constructor".. Any idea?