Module not found: Can’t resolve ‘firebase’ in react js

In my reactjs project I have installed firebase using ‘npm i firebase’. And inside of src folder I have created firebase.js file for firebase config.

import firebase from 'firebase'

const firebaseConfig = {
  apiKey: "******",
  authDomain: "****",
  projectId: "***",
  storageBucket: "*****",
  messagingSenderId: "****",
  appId: "****"


export default firebase

Even after installing firebase in my project. It gives error:

Module not found: Can't resolve 'firebase' in '/home/rupak/Projects/web/firebasereact/src'

Can anyone find the problem?


Refer Firebase docs if you are using newer version initializeApp is moved to firebase/app package