添加模块会引发assertionError

时间:2019-02-17 12:24:31

标签: javascript node.js firebase icloud-api

我正在使用Firebase的firebase-admin模块来处理index.js文件,一切正常,直到我决定将apple-icloud模块(https://github.com/MauriceConrad/iCloud-API)导入到index.js中文件。

我需要两个都这样:

var iCloud = require('apple-icloud');
var admin = require('firebase-admin');

在我使用的行:

var db = admin.database();

程序停止并抛出此错误:

/home/loris/HHIOT/node_modules/@firebase/util/dist/index.node.cjs.js:64
        throw assertionError(message);
        ^

Error: Firebase Database (${JSCORE_VERSION}) INTERNAL ASSERT FAILED: Missing index implementation for fillDefaults
    at assertionError (/home/loris/HHIOT/node_modules/@firebase/util/dist/index.node.cjs.js:73:12)
    at Object.assert (/home/loris/HHIOT/node_modules/@firebase/util/dist/index.node.cjs.js:64:15)
    at /home/loris/HHIOT/node_modules/@firebase/database/dist/index.node.cjs.js:3347:18
    at Object.map (/home/loris/HHIOT/node_modules/@firebase/util/dist/index.node.cjs.js:896:22)
    at IndexMap.addToIndexes (/home/loris/HHIOT/node_modules/@firebase/database/dist/index.node.cjs.js:3345:31)
    at ChildrenNode.updateImmediateChild (/home/loris/HHIOT/node_modules/@firebase/database/dist/index.node.cjs.js:3545:46)
    at ChildrenNode.updateChild (/home/loris/HHIOT/node_modules/@firebase/database/dist/index.node.cjs.js:3560:25)
    at ChildrenNode.updateChild (/home/loris/HHIOT/node_modules/@firebase/database/dist/index.node.cjs.js:3559:67)
    at SnapshotHolder.updateSnapshot (/home/loris/HHIOT/node_modules/@firebase/database/dist/index.node.cjs.js:9368:41)
    at Repo.updateInfo_ (/home/loris/HHIOT/node_modules/@firebase/database/dist/index.node.cjs.js:12882:24)

我试图将apple-icloud模块导入一个单独的文件中,它确实起作用。 似乎只有在需要apple-icloud和firebase-admin时才会发生此错误。

我发现,如果在Firebase初始化后需要模块,它确实可以工作,知道为什么吗?

这可能是什么原因? 谢谢。

0 个答案:

没有答案