0

I had done everything I found that could work, but no luck. I always end with this error: "Firebase CLI v12.5.2 is incompatible with Node.js v12.18.1 Please upgrade Node.js to version >=16.13.0 || >=18.0.0", which makes no sense to me since I am setting up node to the latest version before trying to make a request to Firebase. If you have any idea on why this is, please let me know!

name: Deploy to Firebase Hosting on PR
on:
  push:
    branches:
      - main
jobs:
  build_and_preview:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: latest
      - uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          repoToken: '${{ secrets.GITHUB_TOKEN }}'
          firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}'
          projectId: ...
          channelId: live
      - uses: w9jds/firebase-action@v1.5.0
        with:
          args: database:set /Request '"NewVersionOfFARKMain"'
          projectId: ...
        env:
          FIREBASE_TOKEN: '${{ secrets.FIREBASERTDB }}'

This is the code I ended up on. Not the only thing I had tried, but the most promising one.

  • Have you checked what version of `node.js` you're running? Also, note that `node.js` and `node` are different things: https://stackoverflow.com/a/20058007/361842 – JohnLBevan Aug 31 '23 at 13:38
  • Doing "- run node --version" results in v18.17.1. If that is not it could you tell me how to use nodejs when calling the github action? – Geo Shwale Aug 31 '23 at 14:13
  • I'm not familiar with this action, but... it looks like you're using [v1.5.0](https://github.com/w9jds/firebase-action/releases/tag/v1.5.0) whilst the latest is [v12.4.0](https://github.com/w9jds/firebase-action/releases/tag/v12.4.0). Have you tried switching to the latest version of that action? Note: for that version it looks like `projectId` should be passed as an environment variable (same as the firebase token) instead of a parameter (at least, from a quick scan of the repo's readme). – JohnLBevan Aug 31 '23 at 14:53

0 Answers0