0

I'm not able to install react-intl.It keeps throwing error

├── UNMET PEER DEPENDENCY react@0.13.3 └── react-intl@2.1.3

npm WARN react-dom@15.3.0 requires a peer of react@^15.3.0 but none was installed.
npm WARN react-intl@2.1.3 requires a peer of react@^0.14.0 || ^15.0.0-0 but none was installed.
npm WARN react-native@0.30.0 requires a peer of react@~15.2.0 but none was installed.

This is my package.json

"dependencies": {
     "baobab": "^1.1.2",
     "baobab-react": "^0.1.1",
     "d3": "^3.5.6",
     "fixed-data-table": "^0.4.6",
     "json2csv": "^2.12.0",
     "lodash": "^3.10.1",
     "moment": "^2.10.6",
     "numeral": "^1.5.3",
     "react": "^0.13.3",
     "react-hot-loader": "^1.3.0",
     "react-motion": "^0.2.7",
     "react-router": "^0.13.3",
     "react-style": "^0.5.5",
     "react-style-webpack-plugin": "^0.4.0",
     "scroller": "0.0.3",
     "superagent": "^1.3.0"   },
"devDependencies": {
     "babel": "^5.8.23",
     "babel-core": "^5.8.23",
     "babel-jest": "^5.3.0",
     "babel-loader": "^5.3.2",
     "esdoc": "^0.2.5",
     "file-loader": "^0.8.4",
     "jest-cli": "^0.5.8",
     "webpack": "^1.12.2",
     "webpack-dev-server": "^1.10.1" 
}
sudo bangbang
  • 27,127
  • 11
  • 75
  • 77
SureshCS
  • 1,005
  • 12
  • 23

2 Answers2

2

Your react version is just ^0.13.3. It means you will get only 0.13.x where x is the largest minor version react is publishing. Looking at the package.json of react-intl, you need 0.14.x or 15.

"peerDependencies": {
    "react": "^0.14.0 || ^15.0.0-0"
},

https://github.com/yahoo/react-intl/blob/master/package.json

It means you have to update your package.json to (note that react becomes 0.14.0:

"dependencies":{  
   "baobab":"^1.1.2",
   "baobab-react":"^0.1.1",
   "d3":"^3.5.6",
   "fixed-data-table":"^0.4.6",
   "json2csv":"^2.12.0",
   "lodash":"^3.10.1",
   "moment":"^2.10.6",
   "numeral":"^1.5.3",
   "react":"^0.14.0",
   "react-hot-loader":"^1.3.0",
   "react-motion":"^0.2.7",
   "react-router":"^0.13.3",
   "react-style":"^0.5.5",
   "react-style-webpack-plugin":"^0.4.0",
   "scroller":"0.0.3",
   "superagent":"^1.3.0"
},
"devDependencies":{  
   "babel":"^5.8.23",
   "babel-core":"^5.8.23",
   "babel-jest":"^5.3.0",
   "babel-loader":"^5.3.2",
   "esdoc":"^0.2.5",
   "file-loader":"^0.8.4",
   "jest-cli":"^0.5.8",
   "webpack":"^1.12.2",
   "webpack-dev-server":"^1.10.1"
}
Vivian
  • 138
  • 2
  • 5
  • ├── UNMET PEER DEPENDENCY react@0.13.3 └─┬ react-intl@2.1.3 ├─┬ intl-messageformat@1.3.0 │ └── intl-messageformat-parser@1.2.0 └── intl-relativeformat@1.3.0 I'm still getting this error after adding peer dependencies to my package.json – SureshCS Aug 02 '16 at 07:09
  • 1
    I have updated my answer. Basically you have to change the dependencies, and then remove the node_modules folder, and run npm install again to re-create the node_modules folder. – Vivian Aug 02 '16 at 08:06
0

Well, If your internet connection is poor, it can occur. as it happened to me. or can react version miss-match with the react-intl "react": "^18.2.0", "react-intl": "^5.25.1"