P2P Dependency issue in React on Travis CI Hosted

When trying to build on a Travis CI server, an error returns stating a peer dependency issue as stated below:

npm ERR! Could not resolve dependency:

npm ERR! peer react@"^15" from react-router-dom@4.1.1

npm ERR! node_modules/react-router-dom

npm ERR!   react-router-dom@"^4.1.1" from the root project

npm ERR! 

npm ERR! Conflicting peer dependency: react@15.7.0

npm ERR! node_modules/react

npm ERR!   peer react@"^15" from react-router-dom@4.1.1

npm ERR!   node_modules/react-router-dom

npm ERR!     react-router-dom@"^4.1.1" from the root project

npm ERR! 

I was initially using npm but switched to yarn on the .travis.yml file, to no success. How do I fix the issue?

Edit: Added package.json

{
  "name": "client",
  "version": "0.1.0",
  "private": true,
  "proxy": {
    "/auth/*": {
      "target": "http://localhost:5000"
    },
    "/api/*": {
      "target": "http://localhost:5000"
    }
  },
  "dependencies": {
    "axios": "^0.16.2",
    "materialize-css": "^0.100.2",
    "react": "^16.0.0-alpha.13",
    "react-dom": "^16.0.0-alpha.13",
    "react-redux": "^5.0.5",
    "react-router-dom": "^4.1.1",
    "react-scripts": "1.0.10",
    "redux": "^3.7.1",
    "redux-form": "^7.0.1",
    "redux-thunk": "^2.2.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}

Thank you.

Hi @Northskool,

As you can see here, react-router-dom has declared the react package as a peerDependencies with a specific version. Meaning react-router-dom expects you to have installed react v15. But you have installed React v16.0.0-alpha.13.

So two solutions:

  1. You should downgrade your react package.
  2. Upgrade your react-router-dom.