npm与UNMET PEER DEPENDENCY有关,与本地反应相关

New*_*ewy 8 npm react-native

我想我对npm如何管理依赖关系感到困惑.我看到了这个:

npm list react-native
project@0.0.1 /Users/me/workspace/project
??? UNMET PEER DEPENDENCY react-native@0.15.0

npm ERR! peer dep missing: react-native@^0.13.2, required by react-native-dialogs@0.0.5
npm ERR! code 1
Run Code Online (Sandbox Code Playgroud)

所以我试试......但我明白了:

   npm install react-native@0.15.0

    ....

    project@0.0.1 /Users/me/workspace/project
??? UNMET PEER DEPENDENCY react-native@0.15.0
  ??? react-tools@0.14.0-beta1  (git+https://github.com/facebook/react.git#b4e74e38e43ac53af8acd62c78c9213be0194245)

npm WARN EPEERINVALID react-native-dialogs@0.0.5 requires a peer of react-native@^0.13.2 but none was installed.
npm ERR! code 1
Run Code Online (Sandbox Code Playgroud)

我的package.json:

{
  "name": "project",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "react-native start"
  },
  "dependencies": {
    "apsl-react-native-button": "^2.1.0",
    "base-64": "^0.1.0",
    "es6-react-mixins": "^0.2.1",
    "fifo": "^2.3.0",
    "money-math": "^2.2.0",
    "react-native": "^0.15.0",
    "react-native-dropdown-android": "0.0.4",
    "react-native-lightbox": "^0.5.0",
    "react-native-mail": "^0.2.4",
    "react-native-router-flux": "^0.3.4",
    "react-native-simpledialog-android": "^1.0.2",
    "react-native-swiper": "^1.3.0",
    "superagent": "^1.4.0",
    "tcomb-form-native": "^0.3.0",
    "utf8": "^2.1.1",
    "react-native-facebook-login": "^1.0.0"
  }
}
Run Code Online (Sandbox Code Playgroud)

Mar*_*kac -1

尝试“npm install”命令的“--save”参数,例如:

npm install react-native@0.15.0 --save
Run Code Online (Sandbox Code Playgroud)