If you are logged in using gcloud, there a way you can individually update your functions to avoid the runtime error:
gcloud functions deploy api \
--runtime=nodejs18 \
--trigger-http \
--region=us-central1 \
--project=`YOUR_PROJ_ID`
I normally run firebase deploy --only functions:api --project YOUR_PROJ_ID
to deploy my api function, but I got hit with the same error. Even changing firebase tools versions did not work. Hope this helps!