Typescript 正在尝试在现有项目下将云功能部署到我的firebase。帮助我修复或查找错误?
错误消息告诉您代码有问题。请仔细阅读:Typescript 正在尝试在现有项目下将云功能部署到我的firebase。帮助我修复或查找错误?,typescript,firebase,google-cloud-functions,Typescript,Firebase,Google Cloud Functions,错误消息告诉您代码有问题。请仔细阅读: C:\Users\alpha\cmj_flutter_app>firebase deploy === Deploying to 'cognitive-matters-journa-11c6a'... i deploying functions Running command: npm --prefix "$RESOURCE_DIR" run lint > functions@ lint C:\Users\alpha\
C:\Users\alpha\cmj_flutter_app>firebase deploy
=== Deploying to 'cognitive-matters-journa-11c6a'...
i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint
> functions@ lint C:\Users\alpha\functions
> eslint "src/**/*"
Running command: npm --prefix "$RESOURCE_DIR" run build
> functions@ build C:\Users\alpha\functions
> tsc
src/index.ts:1:1 - error TS6133: 'functions' is declared but its value is never read.
import * as functions from 'firebase-functions';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\alpha\AppData\Roaming\npm-cache\_logs\2020-11-20T04_21_16_357Z-debug.log
Error: functions predeploy error: Command terminated with non-zero exit code2
您正在第一行声明一个名为functions
的变量,但从未使用过它
我只能想象你没有编辑和保存初始化项目时提供的默认文件。Doug,谢谢你的评论,我刚刚发现了它,如果我可以问一下如何修复该错误,请在代码中以某种方式使用变量
函数
。你不能没有它就部署一个函数。大家好,道格,我仍然在努力修复上面的错误。我遵循了您的建议,但没有成功地再次部署它。请帮忙!
src/index.ts:1:1 - error TS6133: 'functions' is declared but its value is never read.
import * as functions from 'firebase-functions';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~