firebase - Firebase Deploy Cloud Functions - 60 个错误同时出现
问题描述
我有一段时间没有对我的 Firebase Cloud Functions 进行任何更新。我只是对字符串进行了简单的更改,所以我知道它不会是 index.ts 文件中的代码问题。当我尝试部署时,Firebase 要求我更新节点和其他组件,我这样做了,然后我尝试运行部署命令。
我遇到了 60 个看起来像这样的错误(我只包括前几个,因为它们都遵循类似的格式):
node_modules/@grpc/grpc-js/build/src/generated/grpc/channelz/v1/ChannelTrace.d.ts:2:13 - error TS1005: '=' expected.
2 import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from '../../../google/protobuf/Timestamp';
~
node_modules/@grpc/grpc-js/build/src/generated/grpc/channelz/v1/ChannelTrace.d.ts:2:119 - error TS1005: ';' expected.
2 import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from '../../../google/protobuf/Timestamp';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@grpc/grpc-js/build/src/generated/grpc/channelz/v1/ChannelTrace.d.ts:3:13 - error TS1005: '=' expected.
3 import type { ChannelTraceEvent as _grpc_channelz_v1_ChannelTraceEvent, ChannelTraceEvent__Output as _grpc_channelz_v1_ChannelTraceEvent__Output } from '../../../grpc/channelz/v1/ChannelTraceEvent';
~
node_modules/@grpc/grpc-js/build/src/generated/grpc/channelz/v1/ChannelTrace.d.ts:3:153 - error TS1005: ';' expected.
3 import type { ChannelTraceEvent as _grpc_channelz_v1_ChannelTraceEvent, ChannelTraceEvent__Output as _grpc_channelz_v1_ChannelTraceEvent__Output } from '../../../grpc/channelz/v1/ChannelTraceEvent';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@grpc/grpc-js/build/src/generated/grpc/channelz/v1/ChannelTrace.d.ts:4:13 - error TS1005: '=' expected.
4 import type { Long } from '@grpc/proto-loader';
~
node_modules/@grpc/grpc-js/build/src/generated/grpc/channelz/v1/ChannelTrace.d.ts:4:27 - error TS1005: ';' expected.
4 import type { Long } from '@grpc/proto-loader';
~~~~~~~~~~~~~~~~~~~~
node_modules/@grpc/grpc-js/build/src/generated/grpc/channelz/v1/Channelz.d.ts:1:13 - error TS1005: '=' expected.
1 import type * as grpc from '../../../../index';
~
Found 60 errors.
Error: functions predeploy error: Command terminated with non-zero exit code2
知道如何解决这个问题吗?
解决方案
当我尝试运行 firebase serve 时,我遇到了同样的问题,函数和公共文件夹中出现 60 个错误,原因是缺少依赖项(依赖项没有以某种方式安装)。
我跑了yarn
,它给了我警告,这也解释了缺少什么以及在哪里。
% yarn
yarn install v1.22.17
[1/5] Resolving packages...
[2/5] Fetching packages...
[3/5] Linking dependencies...
warning "workspace-aggregator-... > PATH/common > react-mapbox-gl@4.6.0" has unmet
peer dependency "prop-types@^15.6.2".
这是警告之一。在yarn add prop-types
公共文件夹中之后,它就消失了。我手动更新了每个警告,这为我解决了问题。我必须更新的一件事是打字稿,它解决了 48/60 错误,但我不得不几乎一一解决其余的问题。
推荐阅读
- ubuntu - 无法登录到 ec2 实例,因为我将 ubuntu 的 chown 更改为另一个用户
- php - Cpanel 中的 Cron 作业 - 时区问题
- json - 如何将 db 结果行转换为嵌套的 json 格式
- react-native - 如何在本机反应中使用共享代码库制作多个应用程序变体?
- reactjs - 在 Create-React-App 测试套件中运行 axe-core 测试
- vbscript - 使用 WScript.shell 运行 sqlcmd - waitonreturn 不启动
- python - 如何使用 tensorflow 处理嵌套循环?
- python - Graphene-Python:从 Django 模型自动生成模式
- c# - System.Runtime.InteropServices.COMException:“已尝试多次添加相同的字段。” Outlook vsto addin c#中的错误
- python - Python 导入导致 [WinError 193] %1 不是有效的 Win32 应用程序,尽管导入在 `cmd` 中有效