I am encountering a problem when trying to use npm installto install reduxin my project react-native. Every time I run npm install redux --save, the directory react-nativeinside node_moduleswill be cleared.
Then I use rm -rf node_modules && npm install, the package is react-nativenot installed inside node_modules, so I have to recreate the project.
I also try to copy and past react-reduxand reduxin node_modulesfrom another project in my current project react-native. But this cannot be successful, the error will lead me to issue on github. I have been following this help and it also fails.
Other information:
➜ npm: 5.0.3
➜ response-native-cli: 2.0.1
➜ reaction-native: 0.45.0
➜ package.json
{
"name": "MyProjectNAME",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.0.0-alpha.12",
"react-native": "0.45.0",
"react-redux": "^5.0.5",
"redux": "^3.6.0"
},
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-jest": "20.0.3",
"babel-preset-es2015": "^6.24.1",
"babel-preset-es2017": "^6.24.1",
"babel-preset-react-native": "1.9.2",
"jest": "20.0.4",
"react-test-renderer": "16.0.0-alpha.12"
},
"jest": {
"preset": "react-native"
}
}
.