如何在没有angularfire2的情况下使用带有angular2的firebase3

时间:2016-09-09 11:13:59

标签: angular typescript firebase firebase-authentication angularfire2

我一直在使用angular2快速入门代码来构建基本的待办事项应用。

我希望添加一个登录页面和连接到firebase来存储和检索todo,但是firebase3实现有问题。

我可以通过删除启动脚本中的 tsc 调用来实现它(如下所示),但这似乎是一个短期修复。

"start": "concurrently \"npm run tsc:w\" \"npm run lite\" "

当我运行 npm start 时我得到的错误说它无法在我的component.tsc文件中使用它时找到名称firebase。我也注意到我还没有找到firebase 3全局打字下载,所以只有firebase 2打字。

firebase 2和3的布局如何(firebase 3仅在index.html中,而firebase 2似乎在整个声明中)可能导致问题???

请注意我的firebase体验非常有限,所以我可能会误读fb2和fb3之间的区别。

下面是我目前得到的错误 npm start

> angular2-quickstart@1.0.0 start /Users/ahiggins/Documents/angular_2/tutorials/todo
> tsc && concurrently "npm run tsc:w" "npm run lite" 

app/login/login.component.ts(25,9): error TS2304: Cannot find name 'firebase'.
app/login/login.component.ts(47,9): error TS2304: Cannot find name 'firebase'.
app/login/login.component.ts(56,13): error TS2304: Cannot find name 'firebase'.
app/login/login.component.ts(59,56): error TS2304: Cannot find name 'firebase'.
app/app.component.ts(16,9): error TS2304: Cannot find name 'firebase'.

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/6.4.0/bin/node" "/Users/ahiggins/.npm-packages/bin/npm" "start"
npm ERR! node v6.4.0
npm ERR! npm  v3.10.6
npm ERR! code ELIFECYCLE
npm ERR! angular2-quickstart@1.0.0 start: `tsc && concurrently "npm run tsc:w" "npm run lite" `
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the angular2-quickstart@1.0.0 start script 'tsc && concurrently "npm run tsc:w" "npm run lite" '.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular2-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     tsc && concurrently "npm run tsc:w" "npm run lite" 
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs angular2-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls angular2-quickstart
npm ERR! There is likely additional logging output above.

0 个答案:

没有答案