Google cloud firestore 更新到Typescript依赖项后未部署Firestore云函数

Google cloud firestore 更新到Typescript依赖项后未部署Firestore云函数,google-cloud-firestore,google-cloud-functions,Google Cloud Firestore,Google Cloud Functions,我对Firebase函数比较陌生,并通过了基本的hello world教程来配置Firestore,以便能够开始编写云函数 我有以下代码: import * as functions from 'firebase-functions'; // Start writing Firebase Functions // https://firebase.google.com/docs/functions/typescript export const helloWorld = functions.

我对Firebase函数比较陌生,并通过了基本的hello world教程来配置Firestore,以便能够开始编写云函数

我有以下代码:

import * as functions from 'firebase-functions';

// Start writing Firebase Functions
// https://firebase.google.com/docs/functions/typescript

export const helloWorld = functions.https.onRequest((request, response) => {
 response.send("Hello from Firebase!");
});
从项目根目录运行firebase deploy时,会显示以下消息:

node_modules/firebase-functions/lib/function-builder.d.ts(60,93): error TS1005: ';' expected.
node_modules/firebase-functions/lib/function-builder.d.ts(60,94): error TS1003: Identifier expected.
node_modules/firebase-functions/lib/function-builder.d.ts(60,114): error TS1005: ';' expected.
node_modules/gaxios/build/src/index.d.ts(14,66): error TS1005: '>' expected.
node_modules/gaxios/build/src/index.d.ts(14,103): error TS1109: Expression expected.
我在网上做了一些搜索,发现这是由依赖项中的旧版本类型脚本造成的。我将依赖项更新为3.3.1。这是我的package.json:

"devDependencies": {
    "tslint": "~5.8.0",
    "typescript": "~3.3.1"
  },

但是,我在后续部署中仍然会遇到此错误。有人知道我如何排除故障吗?

解决了这个问题!必须使用以下内容更新Firestore:

npm install firebase-admin@latest firebase-functions@latest
然后使用以下命令更新Typescript

npm install -g typescript