3

I'm trying to deploy my firebase functions but all the functions return me error, I had already deployed before without any error. I did not install anything new since the last time that a deploy was correct. Every functions return almost the same error, the only thing that changes is the "errorId"

I have tried to logout from firebase-cli and login again, i have updated firebase-tools, firebase-admin, firebase-functions from npm. I'm deploying with firebase deploy --only functions

Deployment error. Build failed:

{
  "error": {
    "canonicalCode": "INVALID_ARGUMENT",
    "errorMessage": "`npm_install` had stderr output:\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@types/lodash-973f4ada/common/collection.d.ts'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@types/node-29231f2f/inspector.d.ts'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@types/node-f1c8db24/inspector.d.ts'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@firebase/auth-1b85ce5b/dist/auth.esm.js.map'\nnpm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@firebase/webchannel-wrapper-e6854ec7/dist/index.js'\nnpm ERR! code E404\nnpm ERR! 404 Not Found: [email protected]\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /builder/home/.npm/_logs/2019-06-08T18_16_17_266Z-debug.log\n\nerror: `npm_install` returned code: 1",
    "errorType": "InternalError",
    "errorId": "FD2536C1"
  }
}

Package.json :

{
  "name": "functions",
  "engines": {
    "node": "8"
  },
  "description": "Cloud Functions for Firebase",
  "scripts": {
    "lint": "eslint .",
    "serve": "firebase serve --only functions",
    "shell": "firebase functions:shell",
    "start": "npm run shell",
    "deploy": "firebase deploy --only functions",
    "logs": "firebase functions:log"
  },
  "dependencies": {
    "@firebase/storage": "^0.2.16",
    "@google-cloud/vision": "^0.24.0",
    "@sendgrid/mail": "^6.4.0",
    "cors": "^2.8.5",
    "dateformat": "^3.0.3",
    "firebase": "^5.11.1",
    "firebase-admin": "^7.4.0",
    "firebase-functions": "^2.3.1",
    "json2csv": "^4.5.1",
    "mailchimp-api-v3": "^1.13.0",
    "moment-timezone": "^0.5.25",
    "openpay": "^1.0.3",
    "paypal-rest-sdk": "^1.8.1",
    "request": "^2.88.0"
  },
  "devDependencies": {
    "eslint": "^4.12.0",
    "eslint-plugin-promise": "^3.6.0",
    "firebase-functions-test": "^0.1.6"
  },
  "private": true
}

Correct deploy of the functions.

Update*** I have tried to delete everything and uninstall every package except for the ones required for firebase-functions and start over with one test function in node 8 i'm having the same issue, with node 6 it was deployed, but i need to use node 8 because i need to use await/async

4
  • Could you expand a lutter more about tour setup? We need more information to help you Commented Jun 8, 2019 at 18:34
  • Its complairont about missing package, havé u triés installing thèm? Most of them are types, maybe uses but libraries you are using Commented Jun 8, 2019 at 19:28
  • Yes, i have installed them all... Commented Jun 8, 2019 at 20:20
  • I have a similar setup. However, it fails when I use a private github dependency: e.g. ` "dependency": "github:org/repo#v1.0.0" ` Commented Jun 17, 2019 at 1:51

4 Answers 4

6

I had a similar deployment failure. I think it was caused by me running firebase deploy from the app directory rather the the app\functions directory. In any case, I ran the following commands from the terminal (using VSCode in my case) having changed into the app\functions directory. Deployment then worked perfectly.

npm install --save @google-cloud/storage
npm install --save firebase-admin@latest
npm install --save firebase-functions@latest
firebase deploy

Hope that helps.

Sign up to request clarification or add additional context in comments.

Comments

3

Checking the log

You can examine the actual logs by using this command to open the log

firebase functions:log

Doing this is really helpful since specific issue will usually be visible there. I sometimes even had error as simple as a missing package name in package.json

It would have been much helpful if firebase could show better info on the errors directly. but at least we can find them here.

I hope it helps

Comments

1

I had similar issue and it ended up being a missing module in my package.json

You can view more detailed / useful logs here: https://console.cloud.google.com/logs

Comments

0

Firebase functions:log really helps! In my case I had not enabled signin method in the firebase project (:

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.