npm ERR! code ENOENT npm ERR! syscall open npm ERR! path D:\major project/package.json npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or directory, open 'D:\major project\package.json' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent
app.js
import { StatusBar } from 'expo-status-bar';
import * as React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import {NavigationContainer} from "@react-navigation/native";
import {createNativeStackNavigator} from "@react-navigation/native-stack";
import Home from'./Pages/Home'
const Stack = createNativeStackNavigator();
export default function App() {
return (
<View style={styles.container}>
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Home" component={Home}/>
</Stack.Navigator>
</NavigationContainer>
<StatusBar style="auto" />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
package.json
{
"name": "majorproject",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"@react-navigation/native": "^6.0.6",
"@react-navigation/native-stack": "^6.2.5",
"expo": "~43.0.2",
"expo-status-bar": "~1.1.0",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.3",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.8.0",
"react-native-web": "0.17.1"
},
"devDependencies": {
"@babel/core": "^7.16.0",
"metro-react-native-babel-preset": "^0.66.2"
},
"private": true
}
CodePudding user response:
delete nodemodules
the run npm install
CodePudding user response:
delete nodemodules the run
npm install
if now working delete package-lock.json
CodePudding user response:
delete nodemodules and reinstall