【发布时间】:2017-06-06 21:39:31
【问题描述】:
我正在使用 Redux 尝试我的第一个 react-native 应用程序,并在设备上运行应用程序时收到以下错误消息,
“UnableToResolveError:无法从 C:\project\Testing\index.android.js 解析模块 react-redux/native: 模块映射或这些目录中不存在模块:C:\project\Testing\node_modules\react-redux"
package.json:
{
"名称": "测试",
“版本”:“0.0.1”,
“私人”:是的,
“脚本”:{
"开始": "节点 node_modules/react-native/local-cli/cli.js 开始",
“测试”:“开玩笑”
},
“依赖”:{
“反应”:“15.4.1”,
“反应原生”:“0.40.0”,
"react-redux": "^5.0.2",
"redux": "^3.6.0",
“redux-thunk”:“^2.2.0”
},
“devDependencies”:{
"babel-jest": "18.0.0",
"babel-preset-react-native": "1.9.1",
“笑话”:“18.1.0”,
“反应测试渲染器”:“15.4.1”
},
“笑话”:{
“预设”:“反应原生”
}
}
index.android.js:
import React, { AppRegistry } from 'react-native';
import { Provider } from 'react-redux/native';
import App from './src/containers/App';
import configStore from './src/stores/configStore';
const store = configStore();
var TestingApp = React.createClass({
render () {
return (
...
);
}
});
AppRegistry.registerComponent('TestingApp', () => TestingApp);
请协助解决问题。
【问题讨论】:
标签: reactjs react-native react-redux