Reputation: 116
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 emulators
Upvotes: 8
Views: 2864
Reputation: 2124
To me what happened was that I added a test
folder out side of src folder. Because I use typescript the typesctipt compiler lost it and changed the output directory.
So if that's the case, move the other folders inside src
.
Upvotes: 2
Reputation: 79
npm run build
Upvotes: 7