Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 不变违例:";“主要”;尚未注册。如果:*Metro(本地开发服务器)从错误的文件夹运行,则可能发生这种情况_Node.js_React Native_Redux_React Redux - Fatal编程技术网

Node.js 不变违例:";“主要”;尚未注册。如果:*Metro(本地开发服务器)从错误的文件夹运行,则可能发生这种情况

Node.js 不变违例:";“主要”;尚未注册。如果:*Metro(本地开发服务器)从错误的文件夹运行,则可能发生这种情况,node.js,react-native,redux,react-redux,Node.js,React Native,Redux,React Redux,我已将我的index.js更改为此,因为我正在尝试遵循以下步骤: https://www.youtube.com/watch?v=6soHPnHxHxI import { registerRootComponent } from 'expo'; import React from "react"; import { AppRegistry } from "react-native"; im

我已将我的index.js更改为此,因为我正在尝试遵循以下步骤:

https://www.youtube.com/watch?v=6soHPnHxHxI


        import { registerRootComponent } from 'expo';
        import React from "react";
        import { AppRegistry } from "react-native";
        import App from "./App";
        import { name as appName } from "./app.json";
        import { Provider } from "react-redux";
        import { Provider as PaperProvider } from "react-native-paper"
        import store from "./store";
        import 'react-native-gesture-handler';

        const AppRedux = () => {
            <Provider {...{store}}>
                <PaperProvider>
                    <App></App>
                </PaperProvider>
            </Provider>
        }

        // registerRootComponent calls AppRegistry.registerComponent('main', () => App);
        // It also ensures that whether you load the app in the Expo client or in a native build,
        // the environment is set up appropriately
        //AppRegistry.registerComponent(appName, () => AppRedux);


        // registerRootComponent calls AppRegistry.registerComponent('main', () => App);
        // It also ensures that whether you load the app in the Expo client or in a native build,
        // the environment is set up appropriately
        registerRootComponent(AppRedux);

您是否从正确的文件夹运行了
expo start
npm start
?@RagulCs,npm从正确的文件夹启动,我使用可视源代码并从package.json文件运行应用程序,但它是从正确的文件夹运行的,即根项目文件夹请参阅此
Invariant Violation: "main" has not been registered. This can happen if: * Metro (the local dev server) is run from the wrong folder.