Aws-mobile-appsync-sdk-js: NPM v7 & latest react peer dependency failure

Created on 25 Mar 2021  路  2Comments  路  Source: awslabs/aws-mobile-appsync-sdk-js

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: [email protected]
npm ERR! Found: [email protected]
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/[email protected]
npm ERR! node_modules/@react-native-community/async-storage
npm ERR!   peer @react-native-community/async-storage@"^1.11.0" from [email protected]
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

Most helpful comment

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

All 2 comments

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

Downgrade to npm v6. It should fix the issue.

Was this page helpful?
0 / 5 - 0 ratings