错误:错误解析触发器:找不到模块“firebase-functions”

PPS*_*ein 3 node.js firebase google-cloud-functions

每当我尝试了与该消息相关的大多数解决方案时,我都会遇到以下错误消息。请让我知道如何修复它。我刚刚克隆了https://github.com/davideast/hnpwa-firebase/ 的源代码并部署到我的 firebase 帐户。

我已经安装npm installfunctions文件夹里面。

我的 NodeJS 版本是 v7.0.0

i  deploying functions
i  functions: running predeploy script.

> functions@ build /Users/user/Documents/Projects/firebase/hnpwa-firebase/functions
> tslint -p tslint.json && ./node_modules/.bin/tsc

typeof-compare is deprecated. Starting from TypeScript 2.2 the compiler includes this check which makes this rule redundant.

WARNING: /Users/user/Documents/Projects/firebase/hnpwa-firebase/functions/src/index.ts[1, 13]: 'functions' is declared but its value is never read.

?  functions: Finished running predeploy script.
i  functions: ensuring necessary APIs are enabled...
?  functions: all necessary APIs are enabled
i  functions: preparing dist/server directory for uploading...

Error: Error parsing triggers: Cannot find module 'firebase-functions'

Try running "npm install" in your functions directory before deploying.
Run Code Online (Sandbox Code Playgroud)

小智 6

尝试使用 -g 或 save-dev 参数进行安装。

npm install -g firebase-functions

npm install --save-dev firebase-functions

npm install firebase-functions
Run Code Online (Sandbox Code Playgroud)

这几乎解决了我找不到模块的所有问题。:D