我尝试安装了几个与React相关的npm模块,但是我遇到了peerDependencies错误。版本对我来说似乎没问题:
npm ERR! peerinvalid The package react does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer react-autosuggest@3.3.1 wants react@^0.14.5
npm ERR! peerinvalid Peer react-bootstrap@0.28.2 wants react@>=0.14.0
npm ERR! peerinvalid Peer react-dom@0.14.6 wants react@^0.14.6
npm ERR! peerinvalid Peer react-router-bootstrap@0.20.1 wants react@>=0.14.0
npm ERR! peerinvalid Peer react-switch-button@1.1.1 wants react@^0.13.3
没有反应@0.14.6满足所有:
我的package.json是:
{
"name": "Test",
"version": "1.0.0",
"description": "",
"dependencies": {
"babel-core": "^6.4.0",
"babel-loader": "^6.2.1",
"babel-plugin-transform-react-jsx": "^6.4.0",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-preset-stage-0": "^6.3.13",
"history": "^1.17.0",
"jquery": "^2.2.0",
"lodash": "^4.0.0",
"react": "^0.14.6",
"react-autosuggest": "^3.3.1",
"react-bootstrap": "^0.28.2",
"react-dom": "^0.14.6",
"react-router": "^2.0.0-rc2",
"react-router-bootstrap": "^0.20.1",
"react-switch-button": "^1.1.1",
"webpack": "^1.12.11"
}
}
我错过了什么吗?
答案 0 :(得分:1)
^
Allows changes that do not modify the left-most non-zero digit in the [major, minor, patch] tuple.,因此react@^0.13.3
与react@0.14.6
不匹配。
但它会匹配任何大于或等于0.13.x
的{{1}}版本。