awslabs / aws-mobile-appsync-sdk-js

JavaScript library files for Offline, Sync, Sigv4. includes support for React Native
Apache License 2.0
919 stars 266 forks source link

NPM v7 & latest react peer dependency failure #632

Closed noyfactor closed 2 years ago

noyfactor commented 3 years ago

Do you want to request a feature or report a bug? Bug

What is the current behavior? Using NPM v7, npm install aws-appsync fails due to conflict in peer-dependency requirements:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: sandbox@0.1.0
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8" from @react-native-community/async-storage@1.12.1
npm ERR! node_modules/@react-native-community/async-storage
npm ERR!   peer @react-native-community/async-storage@"^1.11.0" from aws-appsync@4.0.3
npm ERR!   node_modules/aws-appsync
npm ERR!     aws-appsync@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

npx create-react-app my-app
cd my-app
npm install aws-appsync

What is the expected behavior? Install succeeds

Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions? NPM v7 and React 17.0.1

noyfactor commented 3 years ago

workaround: use npm install aws-appsync --legacy-peer-deps which was the default behaviour in NPM v6

arjunsatyanandaraju commented 3 years ago

Downgrade to npm v6. It should fix the issue.

CodySwannGT commented 2 years ago

Will a fix be released for this?

sammartinez commented 2 years ago

workaround: use npm install aws-appsync --legacy-peer-deps which was the default behaviour in NPM v6

Apologizes folks on this ! Please you this workaround as we work on this issue.

iartemiev commented 2 years ago

This is fixed in aws-appsync@4.1.2. Closing the issue

iartemiev commented 2 years ago

@CodySwannGT can you try deleting your node_modules and lock file, then re-installing?

asyschikov commented 2 years ago

@iartemiev aws-appsync 4.1.4, same-ish error (fresh directory): (npm 7.15.1)

npm i aws-appsync                    
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: graphql@undefined
npm WARN node_modules/graphql
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer graphql@"0.13.0 | 14.x | 15.x" from aws-appsync@4.1.4
npm WARN node_modules/aws-appsync
npm WARN   aws-appsync@"^4.1.4" from the root project
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: graphql@undefined
npm WARN node_modules/graphql
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer graphql@"0.11.7 || ^0.12.0 || ^0.13.0 || ^14.0.0" from apollo-cache-inmemory@1.3.12
npm WARN node_modules/aws-appsync/node_modules/apollo-cache-inmemory
npm WARN   apollo-cache-inmemory@"1.3.12" from aws-appsync@4.1.4
npm WARN   node_modules/aws-appsync
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: graphql@undefined
npm WARN node_modules/graphql
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer graphql@"^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0" from apollo-client@2.4.6
npm WARN node_modules/aws-appsync/node_modules/apollo-client
npm WARN   apollo-client@"2.4.6" from aws-appsync@4.1.4
npm WARN   node_modules/aws-appsync
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: graphql@undefined
npm WARN node_modules/graphql
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer graphql@"^0.11.3 || ^0.12.3 || ^0.13.0 || ^14.0.0" from apollo-link@1.2.5
npm WARN node_modules/aws-appsync/node_modules/apollo-link
npm WARN   apollo-link@"1.2.5" from aws-appsync@4.1.4
npm WARN   node_modules/aws-appsync
npm WARN   1 more (apollo-client)
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: graphql@undefined
npm WARN node_modules/graphql
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer graphql@"^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0" from apollo-link-http@1.5.8
npm WARN node_modules/aws-appsync/node_modules/apollo-link-http
npm WARN   apollo-link-http@"1.5.8" from aws-appsync@4.1.4
npm WARN   node_modules/aws-appsync
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: redux@3.7.2
npm WARN node_modules/redux
npm WARN   redux@"^3.7.2" from aws-appsync@4.1.4
npm WARN   node_modules/aws-appsync
npm WARN     aws-appsync@"^4.1.4" from the root project
npm WARN   1 more (@redux-offline/redux-offline)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer redux@"^4" from redux-thunk@2.4.1
npm WARN node_modules/redux-thunk
npm WARN   redux-thunk@"^2.2.0" from aws-appsync@4.1.4
npm WARN   node_modules/aws-appsync