命名空间&firebase'没有出口会员'承诺'

时间:2017-10-04 15:26:43

标签: angularjs firebase angularfire2

我的构建管道(wercker)上出现了一堆错误,但是当我进行firebase部署时,它在我的本地环境中运行良好

不确定这是否与angualarfire2版本不匹配有关?

   ERROR in /pipeline/source/node_modules/angularfire2/database/firebase_list_observable.d.ts (14,62): Namespace 'firebase' has no exported member 'Promise'.
    ERROR in /pipeline/source/node_modules/angularfire2/app/firebase.app.module.d.ts (12,28): Namespace 'firebase' has no exported member 'Promise'.
    ERROR in /pipeline/source/node_modules/angularfire2/interfaces.d.ts (13,35): Namespace 'firebase' has no exported member 'Promise'.
    ERROR in /pipeline/source/node_modules/angularfire2/interfaces.d.ts (14,35): Namespace 'firebase' has no exported member 'Promise'.
    ERROR in /pipeline/source/node_modules/angularfire2/interfaces.d.ts (15,44): Namespace 'firebase' has no exported member 'Promise'.
    ERROR in /pipeline/source/node_modules/angularfire2/interfaces.d.ts (12,32): Namespace 'firebase' has no exported member 'Promise'.
    ERROR in /pipeline/source/node_modules/angularfire2/database/firebase_list_observable.d.ts (15,48): Namespace 'firebase' has no exported member 'Promise'.
    ERROR in /pipeline/source/node_modules/angularfire2/database/firebase_list_observable.d.ts (16,92): Namespace 'firebase' has no exported member 'Promise'.
    ERROR in /pipeline/source/node_modules/angularfire2/database/firebase_object_observable.d.ts (11,31): Namespace 'firebase' has no exported member 'Promise'.
    ERROR in /pipeline/source/node_modules/angularfire2/database/firebase_object_observable.d.ts (12,37): Namespace 'firebase' has no exported member 'Promise'.
    ERROR in /pipeline/source/node_modules/angularfire2/database/firebase_object_observable.d.ts (13,24): Namespace 'firebase' has no exported member 'Promise'.

5 个答案:

答案 0 :(得分:3)

我从firebase 4.5.0降级到4.3.0。 如此解决

答案 1 :(得分:2)

firebase.Promise was removed in version 4.5.0 of the firebase SDK. Now you just use a regular Promise. The following modification fixes your sample.

      signIn(email: string, password: string): Promise<void> {
        return this.auAuth.auth.signInWithEmailAndPassword(email, password);
      }

答案 2 :(得分:1)

npm卸载firebase

npm install-保存firebase@^3.6.5

答案 3 :(得分:0)

必须更新到最新版本的angularfire2(https://next.sonarqube.com/sonarqube/web_api/api/projects

答案 4 :(得分:0)

降级为

&#34; angularfire2&#34;:&#34; ^ 4.0.0-rc.0&#34;, &#34; firebase&#34;:&#34; ^ 3.9.0&#34;

package.json中的

为我工作。