So I wanted to install a dependency using npm which is react-native-router-flux, but since it wasn't working due to the compatibility versions with react & react-native, it was breaking my project app. So I removed it from the package.json file.
Tried removing it by doing:
npm uninstall --save react-native-router-flux
Even tried to remove it manually from the package.json file, but for some reason, now it looks like my whole project is broken due to that.
Now whenever I do npm start
This is what is being displayed in my terminal:
error: bundling: Error: ENOENT: no such file or directory, open '/Users/marian-mac/Documents/dev/example/myapp/node_modules/react-native-router-flux/node_modules/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js'
at Error (native)
at Object.fs.openSync (fs.js:634:18)
at Object.fs.readFileSync (fs.js:502:33)
at Module._readSourceCode (/Users/marian-mac/Documents/dev/example/myapp/node_modules/react-native/packager/src/node-haste/Module.js:200:29)
at Module._getCacheProps (/Users/marian-mac/Documents/dev/example/myapp/node_modules/react-native/packager/src/node-haste/Module.js:420:29)
at Module._readFromTransformCache (/Users/marian-mac/Documents/dev/example/myapp/node_modules/react-native/packager/src/node-haste/Module.js:376:29)
at Module.readCached (/Users/marian-mac/Documents/dev/example/myapp/node_modules/react-native/packager/src/node-haste/Module.js:363:25)
at Promise.resolve.then (/Users/marian-mac/Documents/dev/example/myapp/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:167:29)
at process._tickCallback (internal/process/next_tick.js:103:7)
Bundling `index.ios.js` 94.0% (2941/3033)
I tried to rm -rf /node_modules 100 times and npm install another 100 times and this keeps failing and failing, I can't understand where is trying to access that file! if it was removed!!!
This is my package.json now:
{
"name": "myapp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"moment": "^2.18.1",
"native-base": "^2.1.3",
"react": "16.0.0-alpha.6",
"react-native": "0.44.0",
"react-native-flags": "^1.0.0"
},
"devDependencies": {
"babel-jest": "19.0.0",
"babel-preset-react-native": "1.9.1",
"jest": "19.0.2",
"react-test-renderer": "16.0.0-alpha.6"
},
"jest": {
"preset": "react-native"
}
}
Is also throwing WARNINGS for versions and other things too:
npm WARN [email protected] requires a peer of react@>=15.1.0 but none was installed.
npm WARN @shoutem/[email protected] requires a peer of react@^15.0.0 but none was installed.
npm WARN [email protected] requires a peer of react@^0.13.0 || ^0.14.0 || ^15.0.0 but none was installed.
This is being thrown for native-base dependency:
UNMET PEER DEPENDENCY react@^0.13.0 || ^0.14.0 || ^15.0.0
Can anyone help me? this is driving me crazy, been 'fighting' with this for hours now and I can't continue with my app.
Thanks in advance.
EDIT:
After changing some versions for react, react-native and native-base. Still having warnings and looks like the packager is trying to access a react-native file within react-native-route-flux.1) This is my current package.json
{
"name": "myapp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"moment": "^2.18.1",
"native-base": "^2.1.3",
"react": "16.0.0-alpha.3",
"react-native": "^0.43.0",
"react-native-flags": "^1.0.0"
},
"devDependencies": {
"babel-jest": "19.0.0",
"babel-preset-react-native": "1.9.1",
"jest": "19.0.2",
"react-test-renderer": "16.0.0-alpha.6"
},
"jest": {
"preset": "react-native"
}
}
2) These are the warnings:
npm WARN [email protected] requires a peer of [email protected] but none was installed.
npm WARN [email protected] requires a peer of react@>=15.1.0 but none was installed.
npm WARN @shoutem/[email protected] requires a peer of react@^15.0.0 but none was installed.
npm WARN [email protected] requires a peer of react@^0.13.0 || ^0.14.0 || ^15.0.0 but none was installed.
npm WARN [email protected] requires a peer of react@^16.0.0-alpha.6 but none was installed.
Also throws some UNMET PEER DEPENDENCY on native-base:
├─┬ [email protected]
│ ├─┬ @shoutem/[email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── UNMET PEER DEPENDENCY react@^15.0.0
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── UNMET PEER DEPENDENCY react@^0.13.0 || ^0.14.0 || ^15.0.0
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │ └── [email protected]
│ └── [email protected]
├─┬ UNMET PEER DEPENDENCY [email protected]
And in console when run, throws the red screen error in the simulator from XCode saying:
No Dimension set for key window
Looks it's a known issue according to his github. But damn, I don't want react-native-router-flux anymore, I don't even have it in my package.json nor installed and is still causing trouble, this dependency is a virus.