这些是我为解决问题而采取的步骤.
$ionic start angularfire2test tabs $npm install angularfire2 firebase --save
的package.json
"angularfire2": "^5.0.0-rc.3", "firebase": "^4.5.2",
将Firebase凭据添加到app.module.ts导入默认模块和数据库模块.这是最重要的部分
import { AngularFireModule } from 'angularfire2'; import { AngularFireDatabaseModule } from 'angularfire2/database'; ... @NgModule({ declarations: [ MyApp, AboutPage, ContactPage, HomePage, TabsPage ], imports: [ BrowserModule, IonicModule.forRoot(MyApp), AngularFireModule.initializeApp(firebaseCredentials), AngularFireDatabaseModule ], bootstrap: [IonicApp], entryComponents: [ ....
当我执行$ionic serve时,我在webpackMissingModule(http://localhost:8100/build/vendor.js:119190:82)收到错误消息“找不到模块”@ firebase / database“
检查node_modules文件夹时,@ firebase没有数据库子文件夹,但firebase-folder确实有一个数据库文件夹.
我做错了什么或是AngularFire2的一般问题?
yarn add angularfire2 firebase
tldr:节点:8.4.0 / npm:5.2.0有问题,纱线工作