問題
目前使用的 Node 版本為 V18.17.1 ,透過 yo botbuilder 建立好 Bot 後。
執行 npm start 就會噴錯,如下,
Request.prototype.closed = function closed() {
TypeError: Cannot set property closed of #which has only a getter
at patch (C:\projects\xbot\node_modules\restify\lib\request.js:848:30)
解法
package.json 中 restify 套件的版本是 ~8.5.1 ,
可以依 TypeError: Cannot set property closed of #restify套件 移除,再安裝最新的 restify套件(^11.1.0),如下,
1 | npm remove restify |
或是將 package.json 中的 restify套件版本改成 ^11.1.0,
再執行 npm install
參考資源
TypeError: Cannot set property closed of #
Create a bot with the Bot Framework SDK