0

While installing npm install @apollo/react-hooks, I got the following error message. It tells me about installing graphql with a version higher than 14.3.1, but I have 15.0 installed.

enter image description here

npm WARN @apollo/react-common@3.1.4 requires a peer of graphql@^14.3.1 but none is installed. You must install peer dependencies yourself.      
npm WARN @apollo/react-components@3.1.5 requires a peer of graphql@^14.3.1 but none is installed. You must install peer dependencies yourself.  
npm WARN @apollo/react-hoc@3.1.5 requires a peer of graphql@^14.3.1 but none is installed. You must install peer dependencies yourself.
npm WARN graphql-tag@2.10.3 requires a peer of graphql@^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 but none is installed. You 
must install peer dependencies yourself.
npm WARN react-apollo@3.1.5 requires a peer of graphql@^14.3.1 but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN @apollo/react-hooks@3.1.5 requires a peer of graphql@^14.3.1 but none is installed. You must install peer dependencies yourself.       
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\watchpack\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\jest-haste-map\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\webpack-dev-server\node_modules\fsevents):
 >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN @apollo/react-hooks@3.1.5 requires a peer of graphql@^14.3.1 but none is installed. You must install peer dependencies yourself.       
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\watchpack\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\jest-haste-map\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\webpack-dev-server\node_modules\fsevents):
32","arch":"x64"})
jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
user2371290
  • 297
  • 2
  • 3
  • 8
  • The caret in ^14.3.1 doesn't just mean *"higher than"*, it allows higher *minor versions*, `14.3.1 <= version < 15.0.0`. – jonrsharpe May 30 '20 at 10:45
  • You have graphql 15. You need to downgrade it to 14. [What is caret ^ in package.json?](https://stackoverflow.com/a/22345808/2873538) – Ajeet Shah May 30 '20 at 10:54

2 Answers2

0

From the official github repo it seems like you need to install the following peer dependencies & also graphql should be < 15.0.0 since ^ means minor release i.e >= 14.5.8 and < 15.0.0

So do this npm install graphql@14.6.0

hendrixchord
  • 4,662
  • 4
  • 25
  • 39
0

run this command

npm uninstall grapql

then

npm install graphql
Saeed Zhiany
  • 2,051
  • 9
  • 30
  • 41