Firebase功能停止工作

时间:2017-11-20 22:34:16

标签: firebase google-cloud-functions

详细的堆栈跟踪:错误:无法找到模块' firebase-functions'

我有一个正在运作的项目。现在,当我尝试部署时,它失败了。我从functions文件夹中运行了`npm i。我有' firebase-functions'在我的包裹中。我删除了package-lock,并重新安装。我删除了firebase-functions和firebase-admin并重新读取。

我们正在生产中使用它,所以当我推动firebase进行一个简单的测试项目时,这非常令人沮丧。

非常困惑。感谢。

1 个答案:

答案 0 :(得分:0)

在您的项目中,您应该具有以下结构:

myproject
 +- .firebaserc    # Hidden file that helps you quickly switch between
 |                 # projects with `firebase use`
 |
 +- firebase.json  # Describes properties for your project
 |
 +- functions/     # Directory containing all your functions code
      |
      +- package.json  # npm package file describing your Cloud Functions code
      |
      +- index.js      # main source file for your Cloud Functions code
      |
      +- node_modules/ # directory where your dependencies (declared in
                   # package.json) are installed

您收到此错误:

  

错误:无法找到模块' firebase-functions'

表示模块firebase-functions不在node-modules文件夹中。这可能是因为你把它移到另一个地方,但它需要在你的项目结构中node-module