无法将Firebase部署到Heroku

时间:2018-01-25 12:49:50

标签: node.js firebase heroku google-cloud-functions

我已经使用firebase-functions一段时间了,以便在我的实时数据库中的数据发生变化时发送通知。响应时间比我希望的慢,所以我想测试从我的Heroku服务器运行firebase-functions时的速度。

我创建了一个新目录,我运行了firebase init,选择了functions并安装了npm依赖项。

接下来,在/functions文件夹中,我运行npm i --save firebase-functions@latest来安装firebase-functions。

最后,我将目录连接到我新创建的heroku应用程序,当我提交文件并将它们推送到服务器时,应用程序开始运行后,它给出了一个错误说:

2018-01-25T12:46:36.067188+00:00 heroku[web.1]: Starting process with command `npm start`
2018-01-25T12:46:38.760835+00:00 app[web.1]: 
2018-01-25T12:46:38.760864+00:00 app[web.1]: > functions@ start /app
2018-01-25T12:46:38.760866+00:00 app[web.1]: > npm run shell
2018-01-25T12:46:38.760867+00:00 app[web.1]: 
2018-01-25T12:46:39.349173+00:00 app[web.1]: 
2018-01-25T12:46:39.349185+00:00 app[web.1]: > functions@ shell /app
2018-01-25T12:46:39.349187+00:00 app[web.1]: > firebase experimental:functions:shell
2018-01-25T12:46:39.349188+00:00 app[web.1]: 
2018-01-25T12:46:39.369290+00:00 app[web.1]: sh: 1: firebase: not found
2018-01-25T12:46:39.376687+00:00 app[web.1]: npm ERR! file sh
2018-01-25T12:46:39.377392+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-01-25T12:46:39.377799+00:00 app[web.1]: npm ERR! errno ENOENT
2018-01-25T12:46:39.378259+00:00 app[web.1]: npm ERR! syscall spawn
2018-01-25T12:46:39.381157+00:00 app[web.1]: npm ERR! functions@ shell: `firebase experimental:functions:shell`
2018-01-25T12:46:39.381440+00:00 app[web.1]: npm ERR! spawn ENOENT
2018-01-25T12:46:39.382004+00:00 app[web.1]: npm ERR! 
2018-01-25T12:46:39.382312+00:00 app[web.1]: npm ERR! Failed at the functions@ shell script.
2018-01-25T12:46:39.382734+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-01-25T12:46:39.394334+00:00 app[web.1]: 
2018-01-25T12:46:39.394784+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-01-25T12:46:39.395010+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2018-01-25T12_46_39_386Z-debug.log
2018-01-25T12:46:39.406074+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-01-25T12:46:39.409741+00:00 app[web.1]: npm ERR! errno 1
2018-01-25T12:46:39.411510+00:00 app[web.1]: npm ERR! functions@ start: `npm run shell`
2018-01-25T12:46:39.411748+00:00 app[web.1]: npm ERR! Exit status 1
2018-01-25T12:46:39.416294+00:00 app[web.1]: npm ERR! 
2018-01-25T12:46:39.416538+00:00 app[web.1]: npm ERR! Failed at the functions@ start script.
2018-01-25T12:46:39.416788+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-01-25T12:46:39.430670+00:00 app[web.1]: 
2018-01-25T12:46:39.431270+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-01-25T12:46:39.432272+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2018-01-25T12_46_39_423Z-debug.log
2018-01-25T12:46:39.491615+00:00 heroku[web.1]: Process exited with status 1
2018-01-25T12:46:39.505425+00:00 heroku[web.1]: State changed from starting to crashed

我很难在Heroku上设置我自己的firebase功能,似乎无法在线找到相关指南。

0 个答案:

没有答案