3

我从一个基本的指数启动项目开始,然后按照他们的教程添加了一个 apollo 客户端,最后遇到了一堆对等依赖问题。我该如何解决 - 我需要固定某些版本的 apollo 客户端吗?冲突是什么?

根据本指南添加 apollo 客户端参考:https ://docs.getexponent.com/versions/v12.0.0/guides/using-apollo.html

这是指数启动项目从一开始就存在的单个对等依赖错误(我是否需要以某种方式修复它 - 指数被固定以响应 15.3.2)?

$ npm ls --depth 0

vanilla-exponent@0.0.0 /Users/jinteki/Projects/vanilla-exponent
├── @exponent/ex-navigation@2.3.0
├── @exponent/samples@1.0.2
├── @exponent/vector-icons@2.0.3
├── exponent@12.0.5
├── jest-exponent@0.1.4
├── react@15.3.2
└── react-native@0.37.0 (git+https://github.com/exponentjs/react-native.git#e708008e450ce254e715b7034b6fd63346974c6c)

npm ERR! peer dep missing: react@^15.4.1, required by react-test-renderer@15.4.1

以及我跑步后的所有警告npm install apollo-client react-apollo --save

$ npm ls --depth 0

vanilla-exponent@0.0.0 /Users/jinteki/Projects/vanilla-exponent
├── @exponent/ex-navigation@2.3.0
├── @exponent/samples@1.0.2
├── @exponent/vector-icons@2.0.3
├── UNMET PEER DEPENDENCY apollo-client@0.7.1
├── exponent@12.0.5
├── jest-exponent@0.1.4
├── react@15.3.2
├── react-apollo@0.8.1
├── UNMET PEER DEPENDENCY react-dom@0.14.x || 15.* || ^15.0.0
├── react-native@0.37.0 invalid
├── react-native-maps@0.11.0 extraneous
└── react-native-svg@4.3.0 extraneous

npm ERR! peer dep missing: apollo-client@^0.6.0, required by react-apollo@0.8.1
npm ERR! peer dep missing: react-dom@0.14.x || 15.* || ^15.0.0, required by react-apollo@0.8.1
npm ERR! invalid: react-native@0.37.0 /Users/jinteki/Projects/vanilla-exponent/node_modules/react-native
npm ERR! extraneous: absolute-path@0.0.0 /Users/jinteki/Projects/vanilla-exponent/node_modules/absolute-path
npm ERR! extraneous: art@0.10.1 /Users/jinteki/Projects/vanilla-exponent/node_modules/art
npm ERR! extraneous: babel-plugin-external-helpers@6.18.0 /Users/jinteki/Projects/vanilla-exponent/node_modules/babel-plugin-external-helpers
npm ERR! extraneous: babel-polyfill@6.20.0 /Users/jinteki/Projects/vanilla-exponent/node_modules/babel-polyfill
npm ERR! extraneous: babel-preset-es2015-node@6.1.1 /Users/jinteki/Projects/vanilla-exponent/node_modules/babel-preset-es2015-node
npm ERR! extraneous: babel-preset-fbjs@2.1.0 /Users/jinteki/Projects/vanilla-exponent/node_modules/babel-preset-fbjs
npm ERR! extraneous: base64-js@1.2.0 /Users/jinteki/Projects/vanilla-exponent/node_modules/base64-js
npm ERR! extraneous: connect@2.30.2 /Users/jinteki/Projects/vanilla-exponent/node_modules/connect
npm ERR! extraneous: denodeify@1.2.1 /Users/jinteki/Projects/vanilla-exponent/node_modules/denodeify
npm ERR! extraneous: event-target-shim@1.1.1 /Users/jinteki/Projects/vanilla-exponent/node_modules/event-target-shim
npm ERR! extraneous: fbjs-scripts@0.7.1 /Users/jinteki/Projects/vanilla-exponent/node_modules/fbjs-scripts
npm ERR! extraneous: fs-extra@0.26.7 /Users/jinteki/Projects/vanilla-exponent/node_modules/fs-extra
npm ERR! extraneous: image-size@0.3.5 /Users/jinteki/Projects/vanilla-exponent/node_modules/image-size
npm ERR! extraneous: immutable@3.7.6 /Users/jinteki/Projects/vanilla-exponent/node_modules/immutable
npm ERR! extraneous: inquirer@0.12.0 /Users/jinteki/Projects/vanilla-exponent/node_modules/inquirer
npm ERR! extraneous: jest-haste-map@15.0.1 /Users/jinteki/Projects/vanilla-exponent/node_modules/jest-haste-map
npm ERR! extraneous: joi@6.10.1 /Users/jinteki/Projects/vanilla-exponent/node_modules/joi
npm ERR! extraneous: json5@0.4.0 /Users/jinteki/Projects/vanilla-exponent/node_modules/json5
npm ERR! extraneous: jstransform@11.0.3 /Users/jinteki/Projects/vanilla-exponent/node_modules/jstransform
npm ERR! extraneous: lodash@3.10.1 /Users/jinteki/Projects/vanilla-exponent/node_modules/lodash
npm ERR! extraneous: mime@1.3.4 /Users/jinteki/Projects/vanilla-exponent/node_modules/mime
npm ERR! extraneous: mime-types@2.1.11 /Users/jinteki/Projects/vanilla-exponent/node_modules/mime-types
npm ERR! extraneous: module-deps@3.9.1 /Users/jinteki/Projects/vanilla-exponent/node_modules/module-deps
npm ERR! extraneous: npmlog@2.0.4 /Users/jinteki/Projects/vanilla-exponent/node_modules/npmlog
npm ERR! extraneous: opn@3.0.3 /Users/jinteki/Projects/vanilla-exponent/node_modules/opn
npm ERR! extraneous: plist@1.2.0 /Users/jinteki/Projects/vanilla-exponent/node_modules/plist
npm ERR! extraneous: progress@1.1.8 /Users/jinteki/Projects/vanilla-exponent/node_modules/progress
npm ERR! extraneous: rebound@0.0.13 /Users/jinteki/Projects/vanilla-exponent/node_modules/rebound
npm ERR! extraneous: regenerator-runtime@0.9.6 /Users/jinteki/Projects/vanilla-exponent/node_modules/regenerator-runtime
npm ERR! extraneous: stacktrace-parser@0.1.4 /Users/jinteki/Projects/vanilla-exponent/node_modules/stacktrace-parser
npm ERR! extraneous: temp@0.8.3 /Users/jinteki/Projects/vanilla-exponent/node_modules/temp
npm ERR! extraneous: whatwg-fetch@1.1.1 /Users/jinteki/Projects/vanilla-exponent/node_modules/whatwg-fetch
npm ERR! extraneous: ws@1.1.1 /Users/jinteki/Projects/vanilla-exponent/node_modules/ws
npm ERR! extraneous: xcode@0.8.9 /Users/jinteki/Projects/vanilla-exponent/node_modules/xcode
npm ERR! extraneous: xmldoc@0.4.0 /Users/jinteki/Projects/vanilla-exponent/node_modules/xmldoc
npm ERR! extraneous: yargs@3.32.0 /Users/jinteki/Projects/vanilla-exponent/node_modules/yargs
npm ERR! extraneous: yeoman-environment@1.5.3 /Users/jinteki/Projects/vanilla-exponent/node_modules/yeoman-environment
npm ERR! extraneous: yeoman-generator@0.21.2 /Users/jinteki/Projects/vanilla-exponent/node_modules/yeoman-generator
npm ERR! extraneous: react-native-maps@0.11.0 /Users/jinteki/Projects/vanilla-exponent/node_modules/react-native-maps
npm ERR! extraneous: react-native-svg@4.3.0 /Users/jinteki/Projects/vanilla-exponent/node_modules/react-native-svg
npm ERR! missing: react-native-maps@git+https://github.com/exponent/react-native-maps.git#12853f0, required by exponent@12.0.5
npm ERR! missing: react-native-svg@git+https://github.com/exponent/react-native-svg.git#51ff90cc, required by exponent@12.0.5
npm ERR! missing: jest-resolve@git+https://github.com/exponentjs/jest-resolve.git, required by jest-exponent@0.1.4
npm ERR! peer dep missing: react@^15.4.2, required by react-test-renderer@15.4.2
4

1 回答 1

4

升级到最新的 NPM 版本(4.1)为我解决了这个问题(可以用 完成npm install -g npm

于 2017-02-13T18:35:47.143 回答