Firebase部署在tsc命令处返回错误
我已经设置了Firebase项目来创建一些基本的Firebase函数。在项目中,我正在使用TypeScript
跟随Firebase official documentation,我创建了我的项目。
[最后一步firebase deploy --only functions
使用tsc
命令给出了错误。
$ firebase deploy --only functions
=== Deploying to ‘my-project’…
i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint
> functions@ lint /path/to/functions
> tslint --project tsconfig.json
Running command: npm --prefix "$RESOURCE_DIR" run build
> functions@ build /path/to/functions
> tsc
node_modules/firebase-functions/lib/function-builder.d.ts(60,95): error TS1005: ';' expected.
node_modules/firebase-functions/lib/function-builder.d.ts(60,96): error TS1003: Identifier expected.
node_modules/firebase-functions/lib/function-builder.d.ts(60,116): error TS1005: ';' expected.
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! /some/path/.npm/_logs/2019-02-03T00_10_30_573Z-debug.log
Error: functions predeploy error: Command terminated with non-zero exit code2
Having trouble? Try firebase deploy --help
[似乎某些Firebase库代码未通过tsc
编译/传输步骤。我正在寻找使该部署步骤通过的方法。
我已经遵循this GitHub issue给出的建议,其中包括:
- 将
--skipLibCheck
添加到tsc
命令 - 将
skipLibCheck
添加到项目的生成的functions/tsconfig.json
- 将
isolateModules
添加到functions/tsconfig.json
- 将
./functions/node_modules/@types
添加到typeRoots
文件中的functions/tsconfig.json
阵列中。 - 在
dom
中将compilerOptions.lib
添加到functions/tsconfig.json
中>
以上步骤均不适合我。
如何使我成功部署到Firebase?
我已经设置了Firebase项目来创建一些基本的Firebase函数。在项目中,我正在使用TypeScript在Firebase官方文档之后,我创建了项目。最后一步,...
回答如下:遇到同样的问题,在将Typescript库升级到3.3.1版本并进行npm安装后,便能够进行部署。
Firebase部署在tsc命令处返回错误
我已经设置了Firebase项目来创建一些基本的Firebase函数。在项目中,我正在使用TypeScript
跟随Firebase official documentation,我创建了我的项目。
[最后一步firebase deploy --only functions
使用tsc
命令给出了错误。
$ firebase deploy --only functions
=== Deploying to ‘my-project’…
i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint
> functions@ lint /path/to/functions
> tslint --project tsconfig.json
Running command: npm --prefix "$RESOURCE_DIR" run build
> functions@ build /path/to/functions
> tsc
node_modules/firebase-functions/lib/function-builder.d.ts(60,95): error TS1005: ';' expected.
node_modules/firebase-functions/lib/function-builder.d.ts(60,96): error TS1003: Identifier expected.
node_modules/firebase-functions/lib/function-builder.d.ts(60,116): error TS1005: ';' expected.
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! /some/path/.npm/_logs/2019-02-03T00_10_30_573Z-debug.log
Error: functions predeploy error: Command terminated with non-zero exit code2
Having trouble? Try firebase deploy --help
[似乎某些Firebase库代码未通过tsc
编译/传输步骤。我正在寻找使该部署步骤通过的方法。
我已经遵循this GitHub issue给出的建议,其中包括:
- 将
--skipLibCheck
添加到tsc
命令 - 将
skipLibCheck
添加到项目的生成的functions/tsconfig.json
- 将
isolateModules
添加到functions/tsconfig.json
- 将
./functions/node_modules/@types
添加到typeRoots
文件中的functions/tsconfig.json
阵列中。 - 在
dom
中将compilerOptions.lib
添加到functions/tsconfig.json
中>
以上步骤均不适合我。
如何使我成功部署到Firebase?
我已经设置了Firebase项目来创建一些基本的Firebase函数。在项目中,我正在使用TypeScript在Firebase官方文档之后,我创建了项目。最后一步,...
回答如下:遇到同样的问题,在将Typescript库升级到3.3.1版本并进行npm安装后,便能够进行部署。