【发布时间】:2021-08-05 18:30:22
【问题描述】:
我正在尝试 Firebase 云功能的基本设置。 index.ts 包括一个hello world。但是在部署 firebase 云功能时出现以下错误。
node_modules/firebase-functions/lib/providers/https.d.ts:109:25 - error TS2694: Namespace 'admin' has no exported member 'appCheck'.
109 token: firebase.appCheck.DecodedAppCheckToken;
Found 1 error.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! functions@ build: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the functions@ build script.
Package.json 文件:
{
"name": "functions",
"scripts": {
"lint": "tslint --project tsconfig.json",
"build": "./node_modules/.bin/tsc",
"serve": "npm run build && firebase serve --only functions",
"shell": "npm run build && firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "8"
},
"main": "lib/index.js",
"dependencies": {
"firebase-admin": "^8.6.0",
"firebase-functions": "^3.3.0"
},
"devDependencies": {
"tslint": "^5.12.0",
"typescript": "^3.3.1",
"firebase-functions-test": "^0.1.6"
},
"private": true
}
tsconfig.json 文件
{
"compilerOptions": {
"module": "commonjs",
"noImplicitReturns": true,
"noUnusedLocals": true,
"outDir": "lib",
"sourceMap": true,
"strict": true,
"target": "es2017"
},
"typeRoots": [ "node_modules/@types" ],
"compileOnSave": true,
"include": [
"src"
]
}
我已经运行了npm install firebase-admin@latest firebase-functions@latest 以获得最新的firebase 依赖项。
什么可能导致这个问题?
【问题讨论】:
-
今天也打这个
⚠ functions: package.json indicates an outdated version of firebase-functions. Please upgrade using npm install --save firebase-functions@latest in your functions directory.不应该运行:-(
标签: node.js firebase google-cloud-functions tslint