Home>

I get an error like the second photo in the application development using reactnative. The file structure is like the first piece of the photo.



Also, the main is app.js and the code is below.

import * as firebase from'firebase';
import {createAppContainer} from'react-navigation';
import {createStackNavigator} from'react-navigation-stack';

import MemoListScreen from'./src/screens/MemoListScreen';
import MemoDetailScreen from'./src/screens/MemoDetailScreen';
import MemoEditScreen from'./src/screens/MemoEditScreen';
import LoginScreen from'./src/screens/LoginScreen';
import SignupScreen from'./src/screens/SignupScreen';

/* eslint-disable */
const firebaseConfig = {
  apiKey: "**************************************:",
  authDomain: "**********************************",
  databaseURL: "**************************************",
  projectId: "**********************************",
  storageBucket: "**********************************",
  messagingSenderId: "**********************************",
  appId: "**************************************",
  measurementId: "********************"
};
firebase.default.initializeApp(firebaseConfig);
firebase.analytics();
  // So far
const AppNavigator = createStackNavigator({
  Login: {screen: LoginScreen },
  Signup: {screen: SignupScreen },
  Home: {screen: MemoListScreen },
  MemoDetail: {screen: MemoDetailScreen },
  MemoDetail: {screen: MemoDetailScreen },
  MemoEdit: {screen: MemoEditScreen },

}, {
  defaultNavigationOptions: {
    headerTitle:'memo',
    headerTintColor:'#fff',
    headerBackTitle: null,
    headerStyle: {
      backgroundColor:'#265366',
    },
    headerTitleStyle: {
      color:'#fff',
    },
},
});

export default createAppContainer(App);

The installation of firebase has stopped working, so there is probably a problem there.
What I did was register firebase and run the command npm install --save [email protected]

If anyone knows the cause of the error, please teach me.

  • Answer # 1

    The installation of firebase has stopped working, so there is probably a problem there.

    I wonder if it may not have been installed in the first place?
    Check if you have firebase in package.json

    If not,
    Move to the target PJ with the terminal cd command, and then
    Please try installing firebase again by referring to the following

    https://qiita.com/yonabe710/items/1f4e4e242698d7b897fc
    https://qiita.com/Alex_mht_code/items/e5cd95b8f2a2a3ce656f
    npm install -g firebase-tools