5
        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.

I keep getting this error when importing firebase-admin to my app. I tried updating GRPC, tried downgrading/upgrading node, reinstalled node + npm... everything!!

Anyone know any workarounds for this?

Thanks!

Mike Pech
  • 61
  • 1
  • 1
  • 6

2 Answers2

4

I believe you need to install the deprecated 'http2' package. Try running:

npm install http2

Brandon
  • 119
  • 1
  • 8
-1

I have changed to use yarn. Remove yarn remove firebase-admin Install again yarn add firebase yarn add firebase-admin yarn add http2 And my code can work. I think yarn is better than npm.

Note: http is supported from node version 9.0.0. My Node version is 13.