![](/img/trans.png)
[英]How can I get “firebase deploy --only functions” command to use the package.json in the functions/ directory?
[英]Firebase CLI deploy Error: There was an error reading functions/package.json
我最近在嘗試使用命令firebase deploy --only functions
firebase 雲函數時收到此錯誤。 我的package.json文件如下圖
{
"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
}
使用版本8.4.1
的 npm package firebase firebase-tools
。
npm run build
對我來說發生的事情是我在 src 文件夾之外添加了一個test
文件夾。 因為我使用 typescript typesctipt 編譯器丟失了它並更改了 output 目錄。
因此,如果是這種情況,請將其他文件夾移動到src
中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.