如何在Google Dialogflow Fullfilment内联编辑器中安装npm软件包 [英] How to install npm packages within Google Dialogflow Fullfilment Inline Editor
本文介绍了如何在Google Dialogflow Fullfilment内联编辑器中安装npm软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将一些npm软件包安装到我的聊天机器人中,但是我无法使其正常工作.
I would like to install some npm packages into my chatbot but I cant make this working.
package.json文件如下所示:
package.json file looks as below:
{
"name": "dialogflowFirebaseFulfillment",
"description": "This is the default fulfillment for a Dialogflow agents using Cloud Functions for Firebase",
"version": "0.0.1",
"private": true,
"license": "Apache Version 2.0",
"author": "Google Inc.",
"engines": {
"node": "~6.0"
},
"scripts": {
"start": "firebase serve --only functions:dialogflowFirebaseFulfillment",
"deploy": "firebase deploy --only functions:dialogflowFirebaseFulfillment"
},
"dependencies": {
"actions-on-google": "^1.5.x",
"firebase-admin": "^4.2.1",
"firebase-functions": "^0.5.7",
"apiai": "^4.0.3"
}
}
在index.js中,我有:
In index.js I have:
var jsonQuery = require('json-query');
日志显示: dialogflowFirebaseFulfillment函数加载错误:无法加载文件index.js中的代码.您是否在package.json
The logs says: dialogflowFirebaseFulfillment Function load error: Code in file index.js can't be loaded. Did you list all required modules in the package.json
有什么主意吗?
推荐答案
由于未包含包"json-query"
The error arrived because you didn't include package 'json-query'
一切正常后,运行以下命令.
run below command after all working fine.
npm install json-query
这篇关于如何在Google Dialogflow Fullfilment内联编辑器中安装npm软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文