Search code examples
node.jsfirebaseyarnpkg

Firebase function works locally but returns "error":"MODULE_NOT_FOUND" when calling server deployed version


I am getting a "error":"MODULE_NOT_FOUND" status message when I call a deployed Firebase function through a GET request. The function works just fine locally with firebase emulators:start, so why the dissonance between the deployed and local versions?


Solution

  • Make sure you properly install the node module that seems to be not found using npm install --save WITHIN the /functions folder and not yarn add. When calling firebase deploy, the firebase CLI currently relies on pushing up node modules installed through npm, not yarn.