2

I installed react-native and the global cli.

But when I run npm start, I'm having this error:

Cannot find module 'react-native'

Here is my App.js file. Thank you...

import React from "react";
import { SafeAreaView, View, Text } from "react-native";

function App() {
  return (
    <SafeAreaView
      style={{
        flex: 1,
        alignItems: "center",
        justifyContent: "center",
      }}
    >
      <View
        style={{
          flex: 1,
          alignItems: "center",
          justifyContent: "center",
        }}
      >
        <View style={{ flex: 3 }}>
          <Text>Kayıt Listesi</Text>
        </View>
      </View>
    </SafeAreaView>
  );
}
export default App;

0

1 Answer 1

5

Execute the following steps:

  1. Remove your node_modules directory.
  2. Run npm install.
  3. Run npm start.

The command npm install install everything your project needs into the node_modules directory.

If this does not help, try to add react-native individually by executing the command npm install react-native --save.

It is usually a good idea to initialize a new project using npm init, which creates a package.json file in which npm stores names and versions of all installed packages.

Edit: After we have investigated the whole stack trace it is apparent that we need to install react-native-web via the command npm install react-native-web.

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.