npx firebase-tools@latest links to a broken version of firebase-tools
[REQUIRED] Environment info
Output of npx firebase-tools@latest --version 11.8.0
Github Actions MacOS
[REQUIRED] Test case
npx firebase-tools@latest deploy --only hosting
[REQUIRED] Steps to reproduce
npx firebase-tools@latest deploy --only hosting
[REQUIRED] Expected behavior
Firebase deploys my app
[REQUIRED] Actual behavior
[2022-12-15T14:54:41.822Z] FirebaseError: Failed to make request: Cannot read properties of undefined (reading 'startsWith') at Client.request (/Users/david/workspace/hovercast/hovercast-games/node_modules/firebase-tools/lib/apiv2.js:112:19) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Object.getService (/Users/david/workspace/hovercast/hovercast-games/node_modules/firebase-tools/lib/gcp/run.js:17:26) at async Promise.all (index 1) at async loadExistingBackend (/Users/david/workspace/hovercast/hovercast-games/node_modules/firebase-tools/lib/deploy/functions/backend.js:199:28) at async existingBackend (/Users/david/workspace/hovercast/hovercast-games/node_modules/firebase-tools/lib/deploy/functions/backend.js:175:9) at async matchingEndpoint (/Users/david/workspace/hovercast/hovercast-games/node_modules/firebase-tools/lib/deploy/hosting/convertConfig.js:86:25) at async convertConfig (/Users/david/workspace/hovercast/hovercast-games/node_modules/firebase-tools/lib/deploy/hosting/convertConfig.js:128:34) at async prepare (/Users/david/workspace/hovercast/hovercast-games/node_modules/firebase-tools/lib/deploy/hosting/prepare.js:33:21) at async chain (/Users/david/workspace/hovercast/hovercast-games/node_modules/firebase-tools/lib/deploy/index.js:33:9) at async deploy (/Users/david/workspace/hovercast/hovercast-games/node_modules/firebase-tools/lib/deploy/index.js:68:5)
Error: Failed to fetch Run service undefined
This doesn't happen if I use firebase-tools. Npx is grabbing an older build.
npx [email protected] --version
11.8.0
Unfortunately I cannot replicate this. It reads as if there's a stale (or incorrectly installed) version of firebase-tools somewhere on your system that npx is picking up.
Consider clearing your npx cache (which can be found in the folder specified by npm config get cache - e.g. /Users/<me>/.npm/_npx. You may want to also check that firebase --version alone - if you have an installed version of firebase-tools globally, npx would default to using that version.
Since this isn't an issue with the CLI, I'm going to close this out, but hopefully this helps get you in the right direction to fixing up your firebase CLI!