首页 > 解决方案 > 使用firebase构建角度项目时出错

问题描述

我正在使用 firebase 构建 Angular 项目,并且在运行命令 ng build --prod 时出现以下错误。我安装了最新的 firebase 工具。我还在下面粘贴了警告消息,以便任何人都可以轻松理解。

Warning: Entry point '@angular/fire' contains deep imports into 'C:/Users/Hello/eShop/node_modules/firebase/app'. This is probably not a problem, but may cause the compilation of entry points to be out of order.
Warning: Entry point '@angular/fire/auth' contains deep imports into 'C:/Users/Hello/eShop/node_modules/firebase/app'. This is probably not a problem, but may cause the compilation of entry points to be out of order.
Warning: Entry point '@angular/fire/auth-guard' contains deep imports into 'C:/Users/Hello/eShop/node_modules/firebase/app'. This is probably not a problem, but may cause the compilation of entry points to be out of order.
Warning: Entry point '@angular/fire/database' contains deep imports into 'C:/Users/Hello/eShop/node_modules/firebase/database', 'C:/Users/Hello/eShop/node_modules/firebase/app'. This is probably not a problem, but may
cause the compilation of entry points to be out of order.
Warning: Entry point '@angular/fire/firestore' contains deep imports into 'C:/Users/Hello/eShop/node_modules/firebase/app'. This is probably not a problem, but may cause the compilation of entry points to be out of order.
Warning: Entry point '@angular/fire/functions' contains deep imports into 'C:/Users/Hello/eShop/node_modules/firebase/app'. This is probably not a problem, but may cause the compilation of entry points to be out of order.
Warning: Entry point '@angular/fire/messaging' contains deep imports into 'C:/Users/Hello/eShop/node_modules/firebase/app'. This is probably not a problem, but may cause the compilation of entry points to be out of order.
Warning: Entry point '@angular/fire/performance' contains deep imports into 'C:/Users/Hello/eShop/node_modules/firebase/app'. This is probably not a problem, but may cause the compilation of entry points to be out of order.
Warning: Entry point '@angular/fire/remote-config' contains deep imports into 'C:/Users/Hello/eShop/node_modules/firebase/app'. This is probably not a problem, but may cause the compilation of entry points to be out of order.
Warning: Entry point '@angular/fire/storage' contains deep imports into 'C:/Users/Hello/eShop/node_modules/firebase/storage', 'C:/Users/Hello/eShop/node_modules/firebase/app'. This is probably not a problem, but may cause the compilation of entry points to be out of order.
Warning: Entry point 'angularfire2' contains deep imports into 'C:/Users/Hello/eShop/node_modules/firebase/app', 'C:/Users/Hello/eShop/node_modules/rxjs/Observable'. This is probably not a problem, but may cause the compilation of entry points to be out of order.



ERROR in node_modules/rxjs/Observable.d.ts:1:15 - error TS2307: Cannot find module 'rxjs-compat/Observable'.

1 export * from 'rxjs-compat/Observable';
                ~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/angularfire2/interfaces.d.ts:2:10 - error TS2305: Module '"../../../../../Users/Hello/eShop/node_modules/rxjs/Observable"' has no exported member 'Observable'.

2 import { Observable } from 'rxjs/Observable';
           ~~~~~~~~~~
node_modules/rxjs/Operator.d.ts:1:15 - error TS2307: Cannot find module 'rxjs-compat/Operator'.

1 export * from 'rxjs-compat/Operator';
                ~~~~~~~~~~~~~~~~~~~~~~
node_modules/rxjs/Subscriber.d.ts:1:15 - error TS2307: Cannot find module 'rxjs-compat/Subscriber'.

1 export * from 'rxjs-compat/Subscriber';
                ~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/rxjs/Subscription.d.ts:1:15 - error TS2307: Cannot find module 'rxjs-compat/Subscription'.

1 export * from 'rxjs-compat/Subscription';
                ~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/angularfire2/database/firebase_list_observable.d.ts:1:10 - error TS2305: Module '"../../../../../../Users/Hello/eShop/node_modules/rxjs/Observable"' has no exported member 'Observable'.

1 import { Observable } from 'rxjs/Observable';
           ~~~~~~~~~~
node_modules/angularfire2/database/firebase_list_observable.d.ts:2:10 - error TS2305: Module '"../../../../../../Users/Hello/eShop/node_modules/rxjs/Operator"' has no exported member 'Operator'.

2 import { Operator } from 'rxjs/Operator';
           ~~~~~~~~
node_modules/angularfire2/database/firebase_list_observable.d.ts:3:10 - error TS2305: Module '"../../../../../../Users/Hello/eShop/node_modules/rxjs/Subscriber"' has no exported member 'Subscriber'.

3 import { Subscriber } from 'rxjs/Subscriber';
           ~~~~~~~~~~
node_modules/angularfire2/database/firebase_list_observable.d.ts:4:10 - error TS2305: Module '"../../../../../../Users/Hello/eShop/node_modules/rxjs/Subscription"' has no exported member 'Subscription'.

4 import { Subscription } from 'rxjs/Subscription';
           ~~~~~~~~~~~~
node_modules/angularfire2/database/firebase_object_observable.d.ts:1:10 - error TS2305: Module '"../../../../../../Users/Hello/eShop/node_modules/rxjs/Observable"' has no exported member 'Observable'.

1 import { Observable } from 'rxjs/Observable';
           ~~~~~~~~~~
node_modules/angularfire2/database/firebase_object_observable.d.ts:2:10 - error TS2305: Module '"../../../../../../Users/Hello/eShop/node_modules/rxjs/Operator"' has no exported member 'Operator'.

2 import { Operator } from 'rxjs/Operator';
           ~~~~~~~~
node_modules/angularfire2/database/firebase_object_observable.d.ts:3:10 - error TS2305: Module '"../../../../../../Users/Hello/eShop/node_modules/rxjs/Subscriber"' has no exported member 'Subscriber'.

3 import { Subscriber } from 'rxjs/Subscriber';
           ~~~~~~~~~~
node_modules/angularfire2/database/firebase_object_observable.d.ts:4:10 - error TS2305: Module '"../../../../../../Users/Hello/eShop/node_modules/rxjs/Subscription"' has no exported member 'Subscription'.

4 import { Subscription } from 'rxjs/Subscription';
           ~~~~~~~~~~~~
node_modules/angularfire2/database/query_observable.d.ts:1:10 - error TS2305: Module '"../../../../../../Users/Hello/eShop/node_modules/rxjs/Observable"' has no exported member 'Observable'.

1 import { Observable } from 'rxjs/Observable';
           ~~~~~~~~~~
node_modules/angularfire2/auth/auth.d.ts:3:10 - error TS2305: Module '"../../../../../../Users/Hello/eShop/node_modules/rxjs/Observable"' has no exported member 'Observable'.

3 import { Observable } from 'rxjs/Observable';
           ~~~~~~~~~~

我试图部署这个有角度的 Firebase Web 应用程序,但是在运行命令 ng build --prod 时遇到了错误。

标签: angulartypescriptfirebaserxjs

解决方案


推荐阅读