在本地反应中解决对等依赖性要求

时间:2016-07-27 02:42:04

标签: ios node.js react-native react-redux

我有以下package.json

{
  "name": "MovieReview",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start"
  },
  "dependencies": {
    "lodash": "^4.13.1",
    "moment": "^2.13.0",
    "native-base": "0.4.7",
    "react": "15.1.0",
    "react-native": "0.27.2",
    "react-native-button": "^1.6.0",
    "react-native-code-push": "^1.12.1-beta",
    "react-native-easy-grid": "^0.1.6",
    "react-native-gifted-spinner": "0.0.4",
    "react-native-modalbox": "^1.3.3",
    "react-native-router-flux": "^3.30.4",
    "react-native-vector-icons": "^2.0.3",
    "react-native-webview-android": "^1.1.6",
    "react-redux": "4.4.5",
    "redux": "^3.5.2",
    "redux-persist": "^3.2.2",
    "redux-thunk": "^2.1.0",
    "rx": "^4.1.0",
    "youtube-api": "^2.0.2"
  },
  "devDependencies": {
    "chai": "^3.5.0",
    "mocha": "^2.5.3",
    "remote-redux-devtools": "^0.3.3",
    "remote-redux-devtools-on-debugger": "^0.4.6"
  }
}

我正在尝试在此package.json中安装依赖项。我在我的系统中安装了node v4.0.0。 我的react-native版本为0.27.2

$ react-native --version
react-native-cli: 1.0.0
react-native: 0.27.2

当我尝试在项目文件夹中运行npm install时,我收到以下依赖项错误:

$ sudo npm install
Password:
npm ERR! Darwin 15.6.0
npm ERR! argv "/Users/triple.s/.nvm/versions/node/v4.0.0/bin/node" "/Users/triple.s/.nvm/versions/node/v4.0.0/bin/npm" "install"
npm ERR! node v4.0.0
npm ERR! npm  v2.14.2
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package react@15.1.0 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer native-base@0.4.7 wants react@15.0.2 - 15.1.0
npm ERR! peerinvalid Peer react-native@0.27.2 wants react@15.1.0
npm ERR! peerinvalid Peer react-redux@4.4.5 wants react@^0.14.0 || ^15.0.0-0

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/triple.s/Desktop/MovieReview/npm-debug.log

我尝试通过修改react15.0.0版本更改为15.0.2package.json,但仍会遇到同样的错误。

编辑:

我使用npm更新了npm install -g npm并尝试安装依赖项, 抛出了以下警告消息:

npm WARN native-base@0.4.7 requires a peer of react@15.0.2 - 15.1.0 but none was installed.
npm WARN react-native@0.27.2 requires a peer of react@15.1.0 but none was installed.

这是否意味着,native-basereact-native未安装?

0 个答案:

没有答案