Closed ohabash closed 1 year ago
I found a few problems with this issue:
Hi @ohabash, are your functions set up in an Nx monorepo environment? Unfortunately at this time, Cloud Functions for Firebase does not support monorepo setups, which is likely the reason why the CLI is unable to find the module ../build/Release/sharp-darwin-x64.node
. At deploy time, the CLI will zip the functions source directory and upload it to Google Cloud Storage, so if you have any local references to modules located outside of the functions
directory, then you will encounter a dependency error.
To help us troubleshoot this issue, could you provide more context about your project's directory structure?
@blidd-google yes i am using nx.
do you suggest firebase init functions
in a new directory so that none of the bigger projects' settings are involved?
If you move your functions code into a new directory outside of your Nx monorepo and sharp
is included in your package.json
dependencies, you should be able to deploy with no issues. I'm going to go ahead and close this issue for now, but if you are still encountering the same problem, feel free to ping me on this thread and I can re-open the issue.
Thank you for your help. I did move everything into a clean directory and same error. I dont believe NX is a problem as i have several other functions working fine.. My question remains. why are the npm install errors showing paths from my local machine; the error shows a problem with npm install which should be happening on the remote host. @blidd-google
I dont believe anyone can can use "sharp": "^0.32.0",
in their function as all i have done is added it to my functions/package.json
and that caused this problem.
Its very easy to reproduce.
Related issues
https://github.com/lovell/sharp/issues/3607
Version info
node: => v16.19.0
Steps to reproduce
"sharp": "^0.32.0"
to functions/package.json => dependencies.firebase deploy
Expected behavior
expected
sharp
to be installed on hostActual behavior
npm install is throwing the following error. its curious that the error contains file paths from my local machine. as i was expecting the paths to be from the host server