Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firebase deploy --only functions Error parsing triggers: Cannot find module 'cors' #1329

Closed
orlandomendozagarrido opened this issue May 21, 2019 · 5 comments
Assignees
Labels
Needs: Author Feedback Issues awaiting author feedback

Comments

@orlandomendozagarrido
Copy link

im trying to deploy my functions folder , but I get this error in my console . I tried npm install in root and folder , I upgraded node to current .

✔ functions: Finished running predeploy script.
i functions: ensuring necessary APIs are enabled...
✔ functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...

Error: Error parsing triggers: Cannot find module 'cors'
Require stack:

  • /home/hc-06/Documents/ReactMLFireBaseApp-/MLReactapp/functions/index.js
  • /home/hc-06/.nvm/versions/node/v12.2.0/lib/node_modules/firebase-tools/lib/triggerParser.js

Try running "npm install" in your functions directory before deploying.

@thechenky
Copy link
Contributor

@orlandomendozagarrido please follow the issue template. The required fields are required :)

@thechenky thechenky added Needs: Author Feedback Issues awaiting author feedback incomplete labels May 21, 2019
@abeisgoat
Copy link
Contributor

abeisgoat commented May 21, 2019

This is most likely a bug in your code @orlandomendozagarrido (but it's impossible to tell without the rest of the issue template).

Your code definitely either has require("cors") or import * from "cors" and you don't have that module installed into your functions directory (and it's associated package.json).

Try running npm install cors in your functions/ directory.

@abeisgoat abeisgoat self-assigned this May 21, 2019
@abeisgoat
Copy link
Contributor

Closing due to lack of author response.

@pelx
Copy link

pelx commented Feb 6, 2020

same problem persists. suggestions are not helpful

@immunity20
Copy link

immunity20 commented Jan 12, 2022

Try to delete package-lock.json file and node_modules folder and run again npm install (while you are inside functions folder)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Author Feedback Issues awaiting author feedback
Projects
None yet
Development

No branches or pull requests

5 participants