我一直在使用 angular2 快速入门代码来构建一个基本的待办事项应用程序。
我希望添加一个登录页面和与 firebase 的连接来存储和检索待办事项,但在 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.