nuxt-community / firebase-module

🔥 Easily integrate Firebase into your Nuxt project. 🔥
https://firebase.nuxtjs.org
MIT License
642 stars 98 forks source link

Error: Module `@nuxtjs/firebase` not found. #234

Closed limsocheat closed 4 years ago

limsocheat commented 4 years ago

Try to install @nuxtjs/firebase on fresh project. got bellow error:

 FATAL  Module @nuxtjs/firebase not found.                                                                                                          11:20:36  

  at ModuleContainer.addModule (node_modules\@nuxt\core\dist\core.js:182:17)
  at node_modules\@nuxt\utils\dist\utils.js:1803:43
  at async ModuleContainer.ready (node_modules\@nuxt\core\dist\core.js:43:5)
  at async Nuxt._init (node_modules\@nuxt\core\dist\core.js:685:5)

   ╭─────────────────────────────────────────────────╮
   │                                                 │
   │   ✖ Nuxt Fatal Error                            │
   │                                                 │
   │   Error: Module `@nuxtjs/firebase` not found.   │
   │                                                 │
   ╰─────────────────────────────────────────────────╯

nuxt.config.js

modules: [
    [
      '@nuxtjs/firebase',
      {
        config: {
          apiKey: '<apiKey>',
          authDomain: '<authDomain>',
          databaseURL: '<databaseURL>',
          projectId: '<projectId>',
          storageBucket: '<storageBucket>',
          messagingSenderId: '<messagingSenderId>',
          appId: '<appId>',
          measurementId: '<measurementId>'
        },
        services: {
          auth: true // Just as example. Can be any other service.
        }
      }
    ]
  ],
lupas commented 4 years ago

Hmm, that should work if you have the module installed.

Did you do?

yarn add @nuxtjs/firebase
# OR
npm i @nuxtjs/firebase

See install guide: https://firebase.nuxtjs.org/guide/getting-started/#install

Tadasb commented 4 years ago

Don't forget to do npm i firebase

limsocheat commented 4 years ago

Hmm, that should work if you have the module installed.

Did you do?

yarn add @nuxtjs/firebase
# OR
npm i @nuxtjs/firebase

See install guide: https://firebase.nuxtjs.org/guide/getting-started/#install

I always use npm to install package. I see the folder @nuxtjs/fireabase inside _nodemodules folder, I tried to delete package.lock.json, delete whole _nodemodels and reinstall with npm, but no luck.

then, I tried to install Yarn & install package with yarn, it works. Please check the problem with npm. thanks.

limsocheat commented 4 years ago

Don't forget to do npm i firebase

npm i firebase get error package name firebase not found. then I tried withyarn add firebase. it works.

not sure what problem with npm