如何在Vue js中安装Firebase / auth

时间:2020-04-03 14:11:22

标签: git firebase vue.js npm vuetify.js

我正在研究Vuetify。我想添加Firebase身份验证 命令:

npm install --save firebase firebase/app firebase/auth firebase/database

我收到此错误

npm ERR! Error while executing:
npm ERR! C:\Program Files\Git\cmd\git.EXE ls-remote -h -t ssh://git@github.com/firebase/database.git
npm ERR!
npm ERR! git@github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128

我已经将SSH添加到我的Github中。到目前为止效果很好 请帮助我

1 个答案:

答案 0 :(得分:0)

您只需要做npm install --save firebase

然后在您的firebaseConfig.js文件中,您应该这样做:

import firebase from 'firebase/app';
import 'firebase/database';
import 'firebase/auth';
//...

文档here(选项卡“使用模块捆绑器”)和here(扩展“可用的Firebase JS SDK(将捆绑器与模块一起使用)”类别)中的更多详细信息。