Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase CLI deploy Error: There was an error reading functions/package.json

I recently getting this error when try to deploy the firebase cloud functions using the command firebase deploy --only functions. My package.json file is shown below

{
  "name": "functions",
  "scripts": {
    "lint": "tslint --project tsconfig.json",
    "build": "tsc",
    "serve": "npm run build && firebase emulators:start --only functions",
    "shell": "npm run build && firebase functions:shell",
    "start": "npm run shell",
    "deploy": "firebase deploy --only functions",
    "logs": "firebase functions:log"
  },
  "engines": {
    "node": "10"
  },
  "main": "lib/index.js",
  "dependencies": {
    "cors": "^2.8.5",
    "express": "^4.17.1",
    "firebase-admin": "^8.12.1",
    "firebase-functions": "^3.6.2",
    "stripe": "^8.50.0"
  },
  "devDependencies": {
    "@types/cors": "^2.8.6",
    "dotenv": "^8.2.0",
    "firebase-functions-test": "^0.2.0",
    "tslint": "^5.12.0",
    "typescript": "^3.8.0"
  },
  "private": true
}

Using npm package firebase-tools of version 8.4.1.

Also getting error in firebase emulatorserror in terminal while serve it locally

like image 433
Lal Pratheesh S S Avatar asked Jun 23 '26 13:06

Lal Pratheesh S S


1 Answers

  1. Enter into functions directory
  2. enter the following command npm run build
  3. and then deploy / launch your emulators
like image 122
Tanaka Craig Kaseke Avatar answered Jun 25 '26 16:06

Tanaka Craig Kaseke