Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Firebase deploy fails when including functions directory

isotopic
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 29, 2019

I'm trying to add cloud functions to my firebase project, but when I trigger a delivery (through push), I receive this error:

INFO: Executing the pipe...
INFO: Starting deployment of the project to Firebase.

Error: Error parsing triggers: Cannot find module 'firebase-functions'
Try running "npm install" in your functions directory before deploying.

 

Yes, I tried npm installing everywhere but deploy fails anyway. I don't know if there's some kind of conflict between the two package.json (root and functions). 

When I remove the functions directory, the error goes away - but I'd like to deploy my functions directory upon git push.  Also, when I deploy through _firebase deploy_, there's no error.

 

 

1 answer

1 accepted

2 votes
Answer accepted
Alexander Zhukov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 3, 2019

Hey @isotopic . I wasn't able to reproduce the issue. I'm using the following pipelines yml:

image: node

pipelines:
default:

- step:
name: Deploy to Firebase
deployment: production
script:
- cd functions; npm install; cd ..
- pipe: atlassian/firebase-deploy:0.3.4
variables:
FIREBASE_TOKEN: $FIREBASE_TOKEN
PROJECT_ID: $FIREBASE_PROJECT

Running 'npm install' from the functions/ directory in the same stap worked for me. Have you tried this? 

isotopic
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 3, 2019

I owe you a kidney. 

Like Alexander Zhukov likes this
Alexander Zhukov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 4, 2019

Glad I was able to help :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events