机器人服务不适用于 Node.js 。错误找不到模块 'botbuilder'

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

我通过 'Azure Portal' 使用 Node.js 和 LUIS 创建了一个机器人服务。创建 Bot 后,我​​可以看到 'Chat interface' 永远加载一条消息 'Loading chat interface'。 Bot developer interface

所以我在'dev.botframework.com'中通过'My bots'打开了Bot并测试了连接。它因以下错误而失败。 Bot chat window

当我在聊天框中 ping 'Hi' 时,我可以在日志中看到错误“执行函数时出现异常:Functions.messages”。 mscorlib:错误:找不到模块 'botbuilder'

我可以在 'package.json' 中看到 'botbuildr' 依赖关系,如下所示。

{
  "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"
}

对错误有什么建议吗?

我遇到了同样的问题,并在 kudu 控制台中通过 运行ning npm install 解决了它。

转到您的机器人服务的设置选项卡并单击以打开“高级设置”。您可以在开发工具下找到“Advanced Tools”(kudu)。打开 Debug Consolecd 到你有 package.json 的文件夹(对我来说是 D:\home\site\wwwroot\messages) 和 运行 npm install

之后您可以在 dev.botframework.com 中与机器人通信,尽管聊天界面在 Azure 门户中仍然无法使用。

首先,我应用了 npm install,在出现依赖项错误后(botbuilder-azure) 我将依赖项添加到包 json 并且它确实有效。

通过以下命令安装 botbuilder:

npm install --save botbuilder