找不到模块:导入 firebase-admin 时无法解析“http2”

Mik*_*ech 5 npm firebase reactjs firebase-admin

        Failed to compile
    ./node_modules/@grpc/grpc-js/build/src/channel.js
    Module not found: Can't resolve 'http2' in '/Users/Michael/Development/Projects/mpsa-ntcs/node_modules/@grpc/grpc-js/build/src'

This error occurred during the build time and cannot be dismissed.
Run Code Online (Sandbox Code Playgroud)

将 firebase-admin 导入我的应用程序时,我不断收到此错误。我尝试更新 GRPC,尝试降级/升级节点,重新安装节点 + npm ......一切!

任何人都知道任何解决方法吗?

谢谢!

小智 4

我相信您需要安装已弃用的“http2”包。尝试运行:

npm install http2