错误:无法从`C:\ Users \ wanuuu27 \ AwesomeProject \ App.js`解析模块`react-redux`:模块`react-redux`不存在

时间:2018-04-07 15:25:53

标签: javascript reactjs react-native

import React, { Component } from 'react';
import {Provider} from 'react-redux';
import {reduxForm} from 'redux-form';
import "tachyons"
import FormContainer from './modules/form/form.container';
import configureStore from './modules/store';

const store = configureStore();

import {
    Platform,
    StyleSheet,
    Text,
    View
} from 'react-native';

const instructions = Platform.select({
    ios: 'Press Cmd+R to reload,\n' +
            'Cmd+D or shake for dev menu',
    android: 'Double tap R on your keyboard to reload,\n' +
            'Shake or press menu button for dev menu',
});

type Props = {};
export default class App extends Component<Props> {
    render() {
        return (
            <Provider store={store}>
            <FormContainer />
            </Provider>
        );
    }
}

1 个答案:

答案 0 :(得分:0)

您是否在项目中安装了react-redux?您的package.json文件是否在依赖项下列出了它?如果您的package.json列出了所有这些依赖项,那么您将要(从命令行直接在项目中)npm install运行。

如果您的package.json没有react-redux并且您尝试将其添加到项目中,那么(从命令行,在项目目录中)运行npm install react-redux --save 。该命令会将react-redux添加到package.json并将react-redux包安装到您的node_modules文件夹中。