Reputation: 23
After importing the package, I got an error that says
Module build failed: Error: ENOENT: no such file or directory, open 'C:\Users\hp\react-firebase\node_modules\firebase\dist\index.cjs.js'
I also imported it this way and used it this way
import React from 'react';
import { StyleSheet, Text, View} from 'react-native';
import * as firebase from 'firebase';
const firebaseConfig = {
apiKey: "AIzaSyBBbX7UGC4Pkq4gHu2fO_zDGruliF1EJC8",
authDomain: "react-firebase-881ec.firebaseapp.com",
databaseURL: "https://react-firebase-881ec.firebaseio.com",
projectId: "react-firebase-881ec",
storageBucket: "react-firebase-881ec.appspot.com",
messagingSenderId: "721639090613",
appId: "1:721639090613:web:a70bfb1a95e72aaf8451fc",
measurementId: "G-82VLJWB7SR"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
import {Container, Header, Item, Input, Content, Form, Label, Button} from 'native-base'
export default class App extends React.Component {
render() {
return (
<Container>
<Form>
<Item>
<Label>Email</Label>
<Input
autoCorrect={false}
autoCapitalize="none"
/>
</Item>
</Form>
</Container>
);
}
}
Hope anybody can help
Upvotes: 1
Views: 163
Reputation: 3611
Try the below ones:
npm rebuild node-sass
Or else delete node_modules
folder and re-run npm install
Or else crate the empty file inside the node_modules at the path where the file is missing error is shown.
touch C:\Users\hp\react-firebase\node_modules\firebase\dist\index.cjs.js
Upvotes: 1