Ошибка перед развертыванием функций: команда завершена ненулевым кодом выхода2

Я пытаюсь развернуть свою облачную функцию в ионной структуре, используя командную строку:

firebase deploy --only functions

Ничего страшного. Но когда я добавляю @ types / googlemaps в свой проект с помощью командной строки:

npm install --save @types/googlemaps

Когда я предварительно развертываю свой проект, возникает ошибка:

i  deploying functions
Running command: npm --prefix "%RESOURCE_DIR%" run lint

> functions@ lint C:\Users\PhuDuong\Desktop\Project\testFireStore\functions
> tslint --project tsconfig.json

Running command: npm --prefix "%RESOURCE_DIR%" run build

> functions@ build C:\Users\PhuDuong\Desktop\Project\testFireStore\functions
> tsc

../node_modules/@types/googlemaps/index.d.ts(43,25): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(856,32): error TS2304: Cannot find name 'Node'.
../node_modules/@types/googlemaps/index.d.ts(1780,60): error TS2304: Cannot find name 'Document'.
../node_modules/@types/googlemaps/index.d.ts(2601,31): error TS2304: Cannot find name 'HTMLInputElement'.
../node_modules/@types/googlemaps/index.d.ts(2782,34): error TS2304: Cannot find name 'HTMLDivElement'.
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\PhuDuong\AppData\Roaming\npm-cache\_logs\2018-11-09T07_31_14_838Z-debug.log

Error: functions predeploy error: Command terminated with non-zero exit code2

Есть ли способ исправить это? Спасибо

Я исправил, добавив "dom" к compilerOptions.lib в ./functions/tsconfig.json. Дополнительная информация: github.com/firebase/firebase-tools/issues/749

Phú Dnp 09.11.2018 13:04
Интеграция Angular - Firebase Analytics
Интеграция Angular - Firebase Analytics
Узнайте, как настроить Firebase Analytics и отслеживать поведение пользователей в вашем приложении Angular.
3
1
1 574
0

Другие вопросы по теме