Search code examples
node.jsbotsbotframeworkyeomanyeoman-generator

Creating bot using Yeomen botbuilder


Iam creating a bot using Yeomen botbuilder generator. I successfully installed botbuilder using

 npm install -g yo generator-botbuilder

then configured bot and when I try to run bot using npm start or node index.js Error is coming like this.


C:\Users\Anant\Documents\Bots\anant>node index.js
C:\Users\Anant\Documents\Bots\anant\node_modules\restify\lib\request.js:848
    Request.prototype.closed = function closed() {
                             ^

TypeError: Cannot set property closed of #<Readable> which has only a getter
    at patch (C:\Users\Anant\Documents\Bots\anant\node_modules\restify\lib\request.js:848:30)
    at Object.<anonymous> (C:\Users\Anant\Documents\Bots\anant\node_modules\restify\lib\server.js:33:1)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (C:\Users\Anant\Documents\Bots\anant\node_modules\restify\lib\index.js:10:14)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)

Node.js v18.12.1

I tried to update all packages. Tried to install windows-build-tools again, But its coming that its depreciated and included in node only.


Solution

  • This is due to an incompatibility between restify versions prior to v10.0.0 and Node v18.x. I've opened a pull request to update the botbuilder yo templates, but you can fix this issue by updating restify in your project to v10.0.0.