You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Function deployment fails with npm workspaces/nx - Error: spawn ./node_modules/.bin/firebase-functions ENOENT #4952
If I make a function on the index.js file, and then I try to deploy using: firebase deploy --only functions:nameOfYourFunction
I get an Unexpected Error at the end.
[REQUIRED] Steps to reproduce
Using npm or whatever package manager you prefer, run these on your terminal,
Now under the functions folder, make sure you have installed node modules using npm install,
and finally you create a basic function you like on index.js after you are done importing stuffs, for example:
exports.yourFunctionName = functions.https.onRequest(async(req,res)=>{
functions.logger.log(res.body); //just for an example.
})
Now when you try to do:
firebase deploy --only functions:yourFunctionName
You'll see this error message in the end:
[debug] [2022-09-05T11:21:08.962Z] Building nodejs source
[debug] [2022-09-05T11:21:08.963Z] Could not find functions.yaml. Must use http discovery
[debug] [2022-09-05T11:21:08.972Z] Error: spawn ./node_modules/.bin/firebase-functions ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:476:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
[error]
[error] Error: An unexpected error has occurred.
[debug] [2022-09-05T11:21:09.063Z] Serving at port 9005
[REQUIRED] Expected behavior
Expected behaviour is that the function gets deployed successfully without any error.
[REQUIRED] Actual behavior
Actual behaviour is that function normally get's deployed successfully and just after this update, this issue came into play.
Reacted by jacobg, Derek Burgman, Marcus Wharton, Ben Gorman and Uda Jul
Since there might be something wrong with the new v11.8.0, so It would be really awesome if the engineers took a look at what's up with the latest release...so I am keeping this issue open.
changed the title [-]Unexpected Error while deploying using "firebase deploy --only functions" in [email protected] (latest version).[/-][+]Unexpected Error while deploying using "firebase deploy --only functions" in [email protected] (latest version) (Could not find functions.yaml. Must use http discovery).[/+]on Sep 5, 2022
QQ1 - what tooling are you using for package management (yarn? npm)? Are you usign yarn/npm workspaces?
QQ2 - have you run npm i before deploying your function?
@taeold Hello sir,
First of all, thank you for checking out!
QQ1 - I am using npm for package management.
QQ2 - Yes sir! I ran npm install before deploying.
Thanks for filing the issue @[removed to avoid tagging]!
QQ1 - what tooling are you using for package management (yarn? npm)? Are you usign yarn/npm workspaces? QQ2 - have you run npm i before deploying your function?
Hey. If I may, what if they weren't using npm but yarn and yarn workspaces? We seem to be having the same issue, only with yarn workspaces and for firebase-tools v11.15.0.
Would it be better if I created a new issue for this for full details, or is this fine? Here are some of the other relevant(?) packages and versions: "firebase": "9.12.1" "firebase-admin": "^11.2.0" "firebase-functions": "4.0.1"
I'm seeing a similarish issue with firebase-tools v11.15.0 when running firebase deploy --only functions --debug
debug output:
[2022-10-29T06:03:49.031Z] Building nodejs source
[2022-10-29T06:03:49.032Z] Could not find functions.yaml. Must use http discovery
[2022-10-29T06:03:49.195Z] Serving at port 9005
[2022-10-29T06:03:49.372Z] Got response from /__/functions.yaml Failed to generate manifest from function source: Error
[2022-10-29T06:03:49.381Z] shutdown requested via /__/quitquitquit
Error: Failed to parse build specification:
- FirebaseError Expect manifest yaml to specify a version number
I deleted the existing functions as I thought it would have something do with the versioning but no dice.
After upgrading to 11.21.0, I see this error when starting the functions emulator: Error: spawn /Users/.../functions/node_modules/.pnpm/[email protected][email protected]/node_modules/.bin/firebase-functions ENOENT
Downgraded to 11.20.0 and error went away.
We have encountered this issue where randomly we are able to deploy our gen v2 function and randomly fail with User code failed to load. Cannot determine backend specification error message.
Deeper investigation shows the issue is not having the .yaml file which in turn resulted in an http call which I assumes generates that yaml file.
that http call has a timeout of 30 sec, if the yaml generation was completed under 30 sec our function would deploy otherwise fail..
I started encountering this in a project tonight, even after downgrading to v11.19. I can get it to succeed by commenting out a ton of my code but it consistently hits the error with my full code.
[debug] [2023-04-07T12:56:12.957Z] Building nodejs source
[debug] [2023-04-07T12:56:12.960Z] Could not find functions.yaml. Must use http discovery
[debug] [2023-04-07T12:56:12.975Z] Found firebase-functions binary at 'G:\Github Projects\health-2077\health-2077\dist\functions\node_modules\.bin\firebase-functions'
[debug] [2023-04-07T12:56:14.744Z] Error: spawn UNKNOWN
on firebase tools version 11.25.3. After downgrading to 10.8.0 I was able to deploy my application to firebase hosting.
@ibnzahoor98 downgrading to such an older version is not really a long term fix imo. Plus this issue has been fixed in v11.22.0 as I outlined above.
I'd recommend going back to this version to determine if this issue is the same cause or is a regression since then.
I've kept up with the latest version and this error has not resurfaced so you may be experiencing a different problem with the same error message. And also try to delete node modules folder completely and even the package-lock or yarn-lock file too, and ensure the node version is modern.
I can confirm that v11.22.0 fixes this issue as described in #5448
@ibnzahoor98 downgrading to such an older version is not really a long term fix imo. Plus this issue has been fixed in v11.22.0 as I outlined above.
I'd recommend going back to this version to determine if this issue is the same cause or is a regression since then. I've kept up with the latest version and this error has not resurfaced so you may be experiencing a different problem with the same error message. And also try to delete node modules folder completely and even the package-lock or yarn-lock file too, and ensure the node version is modern.
I can confirm that v11.22.0 fixes this issue as described in #5448
Thank you for pointing out. I will move to 11.22.0
This problem is still happening, downgrading to versions 11.17.0 or 11.22.0 or latest is currently not working for us, can someone please check this? Its a development blocker since deployment is impossible AND emulators won't start.
Reacted by Tarek M AbdAllah, Adam, ezzabuzaid, Vlad Cazacu, Karun Shrestha and Tim
Activity
rahuld600 commentedon Sep 5, 2022
I could fix this issue just by downgrading the version of firebase tools to v10.0.0 using:
npm install -g [email protected]rahuld600 commentedon Sep 5, 2022
Since there might be something wrong with the new v11.8.0, so It would be really awesome if the engineers took a look at what's up with the latest release...so I am keeping this issue open.
[-]Unexpected Error while deploying using "firebase deploy --only functions" in [email protected] (latest version).[/-][+]Unexpected Error while deploying using "firebase deploy --only functions" in [email protected] (latest version) (Could not find functions.yaml. Must use http discovery).[/+]taeold commentedon Sep 6, 2022
Thanks for filing the issue @rahuld600!
QQ1 - what tooling are you using for package management (yarn? npm)? Are you usign yarn/npm workspaces?
QQ2 - have you run
npm ibefore deploying your function?rahuld600 commentedon Sep 7, 2022
@taeold Hello sir,
First of all, thank you for checking out!
QQ1 - I am using npm for package management.
QQ2 - Yes sir! I ran
npm installbefore deploying.vevepeter commentedon Oct 25, 2022
Hey. If I may, what if they weren't using npm but yarn and yarn workspaces? We seem to be having the same issue, only with yarn workspaces and for
firebase-toolsv11.15.0.Would it be better if I created a new issue for this for full details, or is this fine? Here are some of the other relevant(?) packages and versions:
"firebase": "9.12.1""firebase-admin": "^11.2.0""firebase-functions": "4.0.1"joonne commentedon Oct 29, 2022
Hey 👋
I'm seeing a similarish issue with
firebase-toolsv11.15.0 when runningfirebase deploy --only functions --debugdebug output:
I deleted the existing functions as I thought it would have something do with the versioning but no dice.
package.json contents:
48 remaining items
Jimgitsit commentedon Jan 23, 2023
After upgrading to 11.21.0, I see this error when starting the functions emulator:
Error: spawn /Users/.../functions/node_modules/.pnpm/[email protected][email protected]/node_modules/.bin/firebase-functions ENOENTDowngraded to 11.20.0 and error went away.
edenhermelin commentedon Jan 25, 2023
same here, the error appeared after upgrading from
v11.19.0tov11.21.0using
pnpmis there another way to fix it beside downgrading?
ChromeQ commentedon Feb 1, 2023
I can confirm that v11.22.0 fixes this issue as described in #5448
desk-pro commentedon Feb 13, 2023
As mentionned in #5482, I get following error when using v11.22.0 :
TacB0sS commentedon Mar 13, 2023
@taeold
We have encountered this issue where randomly we are able to deploy our gen v2 function and randomly fail with
User code failed to load. Cannot determine backend specificationerror message.Deeper investigation shows the issue is not having the .yaml file which in turn resulted in an http call which I assumes generates that yaml file.
that http call has a timeout of 30 sec, if the yaml generation was completed under 30 sec our function would deploy otherwise fail..
attaching code snippet from the [email protected] sdk
Would appreciate a quick fix for this issue.
Adam.
Fleker commentedon Apr 5, 2023
I started encountering this in a project tonight, even after downgrading to v11.19. I can get it to succeed by commenting out a ton of my code but it consistently hits the error with my full code.
ibnzahoor98 commentedon Apr 7, 2023
I faced this issue
on firebase tools version 11.25.3. After downgrading to 10.8.0 I was able to deploy my application to firebase hosting.
Thank you @JoeEarly @binodnepali for point out what worked for you.
ChromeQ commentedon Apr 7, 2023
@ibnzahoor98 downgrading to such an older version is not really a long term fix imo. Plus this issue has been fixed in v11.22.0 as I outlined above.
I'd recommend going back to this version to determine if this issue is the same cause or is a regression since then.
I've kept up with the latest version and this error has not resurfaced so you may be experiencing a different problem with the same error message. And also try to delete node modules folder completely and even the package-lock or yarn-lock file too, and ensure the node version is modern.
ibnzahoor98 commentedon Apr 7, 2023
Thank you for pointing out. I will move to 11.22.0
Fleker commentedon Apr 14, 2023
I have just updated to 11.27.0 and am still seeing this error.
desk-pro commentedon Apr 20, 2023
@Fleker Same for me
Padreco-lbr commentedon May 3, 2023
This problem is still happening, downgrading to versions 11.17.0 or 11.22.0 or latest is currently not working for us, can someone please check this? Its a development blocker since deployment is impossible AND emulators won't start.
servefast-cto commentedon Sep 25, 2024
Happening for me when updated to 12.5.0 worked for 12.1.0