找不到模块“ Google行动” [英] Cannot find module 'actions-on-google'

查看:58
本文介绍了找不到模块“ Google行动”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在浏览google的教程以了解他们的操作,同时尝试进行一些修改以适合我的尝试。当我运行终端命令 firebase deploy时,经过一番处理后,终端会说:错误解析触发器:找不到模块 Google行动。请在部署前在功能目录中运行npm-install。

I was going through google's tutorial for their action, while trying to make some modifications to suit what I was trying to do. When I run the terminal command 'firebase deploy', after a bit of processing my terminal will say: "Error parsing triggers: Cannot find module 'actions-on-google'. Try running npm-install in your functions directory before deploying.

我已经在functions目录中运行了npm-install,但是没有运气使它起作用。

I have run npm-install in the functions directory, but have had no luck in getting this to work.

这是我的index.js文件中的最高代码:

Here is the top bit of code in my index.js file:

'use strict';

process.env.DEBUG = 'actions-on-google:*';
const {DialogflowApp} = require('actions-on-google');
const functions = require('firebase-functions');

exports.echoNumber = functions.https.onRequest((req, res) => {
  const app = new DialogflowApp({request: req, response: res});


推荐答案

您应该在其中具有package.json文件该目录。它应该有一个dependencies部分,并且在该部分中,您需要的每个软件包都应有一行re()。

You should have a package.json file in that directory. It should have a dependencies section. And in that section there should be a line for every package that you require().

特别是

Google行动: ^ 1.8.0 ,

"actions-on-google": "^1.8.0",

这篇关于找不到模块“ Google行动”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆