Firebase函数部署错误 [英] Firebase Functions Deploy Error

查看:108
本文介绍了Firebase函数部署错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从事这个项目已有很长时间了.部署了很多次. 但是我在一个月左右的时间里打开了这个项目,点击firebase deploy --only功能后,出现以下错误

I've been working on this project a long time. Deployed this many times. But i opened this project after a month or so and I'm getting the following error after hitting firebase deploy --only functions

i  deploying functions
i  functions: ensuring necessary APIs are enabled...
i  runtimeconfig: ensuring necessary APIs are enabled...
✔  runtimeconfig: all necessary APIs are enabled
✔  functions: all necessary APIs are enabled
i  functions: preparing functions directory for uploading...

Error: Error occurred while parsing your function triggers.

Error: The module '/private/var/folders/n3/h9nbc_ys2732s35_9jlgh98c0000gn/T/fbfn_6601274o3l5DKN66/node_modules/grpc/src/node/extension_binary/grpc_node.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 51. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (module.js:598:18)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/private/var/folders/n3/h9nbc_ys2732s35_9jlgh98c0000gn/T/fbfn_6601274o3l5DKN66/node_modules/grpc/src/node/src/grpc_extension.js:38:15)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)

通用信息:

npm -v 5.1.0

npm -v 5.1.0

node -v v8.1.3

node -v v8.1.3

我也在LTS 6.11.0版本中尝试过此方法,该错误看起来有些不同,但仍然相同.

I also tried this with LTS release 6.11.0, the error looks a bit different but still is the same.

i  deploying database, functions, hosting
✔  database: rules ready to deploy.
i  functions: ensuring necessary APIs are enabled...
i  runtimeconfig: ensuring necessary APIs are enabled...
✔  runtimeconfig: all necessary APIs are enabled
✔  functions: all necessary APIs are enabled
i  functions: preparing functions directory for uploading...

Error: Error occurred while parsing your function triggers.

Error: Module version mismatch. Expected 48, got 51.
    at Error (native)
    at Object.Module._extensions..node (module.js:597:18)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/private/var/folders/n3/h9nbc_ys2732s35_9jlgh98c0000gn/T/fbfn_615356S6aA0PtZuOQ/node_modules/grpc/src/node/src/grpc_extension.js:38:15)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)

试图cd进入

/private/var/folders/n3/h9nbc_ys2732s35_9jlgh98c0000gn/T/fbfn_6601274o3l5DKN66/node_modules/grpc/

并运行

npm install --build-from-source

仍然是相同的错误.

我缺少关键的重建步骤吗?

Is there a crucial rebuild step i'm missing ?

推荐答案

已解决.到目前为止, firebase-tools 软件包似乎需要节点V 7.10.0. 通过 nvm 安装.

Solved it. The firebase-tools package seem to need node V 7.10.0 as of now. Installed it via nvm.

这只是一个临时解决方法.如果有人知道如何重建全局程序包的依赖项,请发布.

This is just a temporary fix. If anyone knows how to rebuild the dependency of a global package, please post.

这篇关于Firebase函数部署错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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