【问题标题】:How to install Firebase/auth in Vue js如何在 Vue js 中安装 Firebase/auth
【发布时间】:2020-07-15 17:38:31
【问题描述】:

我正在开发 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

我已经在我的 Github 中添加了 SSH。直到现在它运作良好 请帮帮我

【问题讨论】:

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


    【解决方案1】:

    你只需要npm install --save firebase

    然后在你的firebaseConfig.js 文件中,你会这样做:

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

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

    【讨论】:

    • 感谢您的回复我没有firebaseConfig.js。我在哪里可以创建和配置它?
    • 例如看看这个Github repo。还要看组件中如何导入 Firebase:const fb = require('../firebaseConfig.js')
    猜你喜欢
    • 2020-06-18
    • 2021-05-28
    • 2020-07-29
    • 2020-11-29
    • 2021-11-17
    • 2019-01-26
    • 2018-03-05
    • 1970-01-01
    • 2022-11-08
    相关资源
    最近更新 更多