Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Cannot deploy functions, rules or indexes

Wayne Kaskie September 10, 2020

I started testing out pipelines here will a full featured repo. The pipelines failed.  Eventually, I troubleshot it down to discover that the issue is not with hosting, but the other features.  The one I care most about is firebase functions.

 

The error is that ts-lint is missing.  This makes me think that the problem has to do with "functions" not being at the root and the pipeline doesn't "understand" that.  This repo, also has a front end so it's impractical to put functions at the root.

I run npm install, but this only works for the root project. I also added this to my pipeline:

`npm --prefix ./function install ./function

 

and that didn't seem to help either, as per here: https://stackoverflow.com/questions/13498403/npm-install-dependencies-for-a-package-in-a-different-folder

Anyone have and solve this problem?

Wayne

 

ERROR:

i deploying functions, hosting Running command: npm --prefix "$RESOURCE_DIR" run lint> functions@ lint /opt/atlassian/pipelines/agent/build/functions> tslint --project tsconfig.jsonsh: 1: tslint: not foundnpm ERR! file shnpm ERR! code ELIFECYCLEnpm ERR! errno ENOENTnpm ERR! syscall spawnnpm ERR! functions@ lint: `tslint --project tsconfig.json`npm ERR! spawn ENOENTnpm ERR! npm ERR! Failed at the functions@ lint script.npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm WARN Local package.json exists, but node_modules missing, did you mean to install?npm ERR! A complete log of this run can be found in:npm ERR! /root/.npm/_logs/2020-09-10T14_12_48_386Z-debug.logError: functions predeploy error: Command terminated with non-zero exit code1✖ Deployment failed.

2 answers

1 accepted

1 vote
Answer accepted
Wayne Kaskie September 11, 2020

After updating my question, I realized that what I attempted was correct. I just needed to spell the folder name correctly! 

 

The command to add to the pipeline is:

npm --prefix ./functions install ./functions

note that I was missing the S.  That fixes the tslint issue.  Now, I have another one.

ktomk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 12, 2020

Good to see, and makes sense that the install failed previously.

Like Wayne Kaskie likes this
0 votes
ktomk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 10, 2020

From the error reporting and especially the warning, it looks like that `npm install` has not been run. 

As each pipeline step is running in a new container with only the git project checkout by default (your mileage may vary, options are available):

Check the life cycles of the tooling are complete in each pipeline step. E.g. when using `npm`, `npm install` is normally required.

At least it sounds reasonable to me that this could be the reason that the `tslint` utility is not available.

Just an educated guess: Are you using npm to manage tslint via the tslint package?

Wayne Kaskie September 11, 2020

That is my guess as well, however, I don't know how to remedy it. I can't be the only person using the firebase pipeline for functions.

ktomk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 12, 2020

Guess so, but I'm pretty sure you're not the only person using npm :).

Unrelated to the install issue, I've seen that tslint is deprecated. When you have things up and running, might be something you'd like to look into.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events