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.