2

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.

2 Answers 2

4

Whenever you face such kind situation just be cool and think what all other third parties got installed when the core third party was installed. I faced the similar issue while playing with react-native-router-flux and its stable version is v3.38.0.

From the above question it seems @shoutem/[email protected] and [email protected] came with the react-native-router-flux lib. and the other package i.e native-base is compatible with react@>=15.1.0

so i arose to the conclusion, remove @shoutem and react-static-container from node modules. In case there is still the error then i am damn sure the error is because of the native base. Remove native base completely from the project and wait for native base to update up to the latest version of react.

Try the above things and please share the progress as this can help others too.

Note 1: Whenever you see warning while installing packages please don't ignore those warning as they might be destroying the functionality of some package.

To update the package using npm install [email protected], where x.y is the version number you want to install.

Note 2: To install packages yarn is preferred.

Below are the dependencies updated or installed with react-native-router-flux:

"dependencies": {
    "lodash.isequal": "^4.5.0",
    "react": "^15.4.2",
    "react-addons-pure-render-mixin": "^15.4.2",
    "react-dom": "^15.4.2",
    "react-native": "^0.41.2",
    "react-native-experimental-navigation": "0.26.x",
    "react-native-tabs": "^1.0.9",
    "react-static-container": "1.0.1"
  },

As you can see react-static-container is inherited from react-native-router-flux and the other errors are because of native-base, see the below dependencies provided by native-base .

"dependencies": {
    "@shoutem/animation": "^0.8.9",
    "native-base-shoutem-theme": "0.1.3",
    "blueimp-md5": "^2.5.0",
    "clamp": "^1.0.1",
    "color": "~0.11.1",
    "fs-extra": "^2.0.0",
    "lodash": "~4.11.1",
    "print-message": "^2.1.0",
    "react-native-easy-grid": "0.1.7",
    "react-native-keyboard-aware-scroll-view": "0.2.7",
    "react-native-scrollable-tab-view": "^0.7.1",
    "react-native-vector-icons": "~4.0.0",
    "react-tween-state": "^0.1.5",
    "tween-functions": "^1.0.1",
    "react-native-drawer": "^2.3.0"
  },

Cheers :)

Sign up to request clarification or add additional context in comments.

17 Comments

thanks!! i will try it out in a few hours, i just need to sleep some more, fought with that until 3am. thanks again for taking ur time! i will keep u updated.
Tested it, and even though those warnings are from native-base, it keeps throwing me the no such file or directory for react-native-router-flux, and i still can't figure out why, if it's uninstalled, not even using it in my project, why is it trying to get that file? :S Before i installed react-native-router-flux, i was able to work just fine with the package.json i had containing native-base, etc. That's why i know that dependency screwed up my entire project.
There are two options either remove native-base or change version of react.
Yea, too bad because native-base had a lot of good component i'm using. Right now my react version is the "16.0.0-alpha.6". Can you help me on depending what i want to use, the react, react-native and native-base combo to be fully supported without warnings? should i really use react 15.0.0?
yeah it worked for me. react-native upgrade is called after running react-native command and thereafter react command. Firstly remove native base then do all these steps.
|
0
npm install react-native-reanimated 
react-native-gesture-handler 
react-native-screens 
react-native-safe-area-context 
@react-native-community/masked-view

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.