第一次启动离子项目时出错

问题描述

我在线克隆了一个适用于其他人的 ionic 项目,但是当我执行 ionic serve 时,出现以下错误。该站点说它已启动,但日志中有大量错误,而访问该站点只会显示相同的错误

我有节点 10.16.0,它使用 Angular 5.2.0 代码库和 Ionic。我运行了我认为也需要的 sudo npm install -g cordova@8.0.0 ionic@4.0.1 命令。

查看 package.json,我看到 "angularfire2": "5.3.0"

ionic-app-scripts serve --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser
[app-scripts] [19:39:42]  ionic-app-scripts 3.2.4 
[app-scripts] [19:39:42]  watch started ... 
[app-scripts] [19:39:42]  build dev started ... 
[app-scripts] [19:39:42]  clean started ... 
[app-scripts] [19:39:42]  clean finished in 1 ms 
[app-scripts] [19:39:42]  copy started ... 
[app-scripts] [19:39:42]  deeplinks started ... 
[app-scripts] [19:39:42]  deeplinks finished in 242 ms 
[app-scripts] [19:39:42]  transpile started ... 
[app-scripts] [19:39:50]  typescript: node_modules/@angular/fire/auth/auth.d.ts,line: 8 
[app-scripts]             Cannot find name 'User'. 
[app-scripts]        L7:  readonly auth: FirebaseAuth;
[app-scripts]        L8:  readonly authState: Observable<User | null>;
[app-scripts]        L9:  readonly idToken: Observable<string | null>;
[app-scripts] [19:39:50]  typescript: node_modules/@angular/fire/auth/auth.d.ts,line: 10 
[app-scripts]             Cannot find name 'User'. 
[app-scripts]        L9:  readonly idToken: Observable<string | null>;
[app-scripts]       L10:  readonly user: Observable<User | null>;
[app-scripts]       L11:  readonly idTokenResult: Observable<auth.IdTokenResult | null>;
[app-scripts]             Namespace ''*'' has no exported member 'IdTokenResult'. 
[app-scripts] [19:39:50]  typescript: node_modules/@angular/fire/auth/auth.d.ts,line: 11
[7:49 PM]
[app-scripts]       L10:  readonly user: Observable<User | null>;
[app-scripts]       L11:  readonly idTokenResult: Observable<auth.IdTokenResult | null>;
[app-scripts]       L12:  constructor(options: FirebaSEOptions,nameOrConfig: string | FirebaseAppConfig | null | undefined,platformId: Object,zone: ngzone);
[app-scripts]             Namespace '''' has no exported member 'Database'. 
[app-scripts] [19:39:50]  typescript: node_modules/@angular/fire/firebase.app.module.d.ts,line: 13 
[app-scripts] [19:39:50]  typescript: node_modules/@angular/fire/firebase.app.module.d.ts,line: 14 
[app-scripts] [19:39:50]  typescript: node_modules/@angular/fire/firebase.app.module.d.ts,line: 16 
[app-scripts] [19:39:50]  typescript: node_modules/@angular/fire/firebase.app.module.d.ts,line: 18 
[app-scripts]       L12:  export declare const FIREBASE_APP_NAME: InjectionToken<string | FirebaseAppConfig | undefined>;
[app-scripts]       L13:  export declare type FirebaseDatabase = database.Database;
[app-scripts]       L14:  export declare type FirebaseAuth = auth.Auth;
[app-scripts]             Namespace '''' has no exported member 'Auth'. 
[app-scripts]       L13:  export declare type FirebaseDatabase = database.Database;
[app-scripts]       L14:  export declare type FirebaseAuth = auth.Auth;
[app-scripts]       L15:  export declare type FirebaseAnalytics = any;
[app-scripts]             Namespace '''' has no exported member 'Messaging'. 
[app-scripts]       L15:  export declare type FirebaseAnalytics = any;
[app-scripts]       L16:  export declare type FirebaseMessaging = messaging.Messaging;
[app-scripts]       L17:  export declare type FirebasePerformance = any;
[app-scripts]             Namespace '''' has no exported member 'Storage'. 
[app-scripts]       L17:  export declare type FirebasePerformance = any;
[7:49 PM]
[app-scripts]       L18:  export declare type FirebaseStorage = storage.Storage;
[app-scripts]       L19:  export declare type FirebaseFirestore = firestore.Firestore;
[app-scripts]             Namespace '''' has no exported member 'Firestore'. 
[app-scripts]       L18:  export declare type FirebaseStorage = storage.Storage;
[app-scripts]       L19:  export declare type FirebaseFirestore = firestore.Firestore;
[app-scripts]       L20:  export declare type FirebaseFunctions = functions.Functions;
[app-scripts]             Namespace '''' has no exported member 'Functions'. 
[app-scripts]       L19:  export declare type FirebaseFirestore = firestore.Firestore;
[app-scripts]       L20:  export declare type FirebaseFunctions = functions.Functions;
[app-scripts]       L21:  export declare type FirebaseRemoteConfig = any;
[app-scripts]             Namespace ''*'' has no exported member 'auth'. 
[app-scripts]       L13:  // firebase auth - google - Create an instance of the Google provider object:
[app-scripts]       L14:  let googleProvider: firebase.auth.GoogleAuthProvider = new firebase.auth.GoogleAuthProvider();
[app-scripts]       L15:  // let twitterProvider: firebase.auth.TwitterauthProvider = new firebase.auth.TwitterauthProvider();
[app-scripts] [19:39:50]  typescript: node_modules/@angular/fire/firebase.app.module.d.ts,line: 19 
[app-scripts] [19:39:50]  typescript: node_modules/@angular/fire/firebase.app.module.d.ts,line: 20 
[app-scripts] [19:39:50]  typescript: src/pages/signup/signup.ts,line: 14
[7:50 PM]
[INFO] Development server running!

       Local: http://localhost:8100/
       External: http://192.168.86.61:8100/
       DevApp: my0site@8100 on imac.lan

       Use Ctrl+C to quit this process

[INFO] browser window opened to http://localhost/:8100!

[app-scripts] [19:39:50]  copy finished in 8.68 s 
[app-scripts] [19:39:51]  watch ready in 9.22 s

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)