2016-08-01 134 views
0

我不能安裝react-intl.It不斷拋出錯誤無法使用NPM

├──未滿足PEER DEPENDENCY [email protected]└──反應-國際機場安裝陣營,國際@ 2.1.3

npm WARN [email protected]需要[email protected]^15.3.0的同行,但沒有安裝 。
npm WARN [email protected]要求同行 [email protected]^0.14.0 ||^15.0.0-0但沒有安裝。
npm WARN [email protected]需要[email protected]~15.2.0的同行,但沒有人安裝了 。

這是我的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" 
} 

回答

2

你的反應版本只是^ 0.13.3。這意味着你只會得到0.13.x,其中x是反應發佈的最大次要版本。縱觀反應,國際的的package.json,你需要0.14.x或15

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

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

這意味着你需要更新你的package.json來(注意,反應變得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" 
} 
+0

├──未滿足PEER DEPENDENCY [email protected] └─┬[email protected] ├─┬[email protected] │└──INTL-的MessageFormat解析器@ 1.2.0 └──intl-relat [email protected]添加對等關係到我的package.json後,我仍然收到這個錯誤 –

+1

我已經更新了我的答案。基本上,您必須更改依賴項,然後刪除node_modules文件夾,然後再次運行npm install以重新創建node_modules文件夾。 – Vivian