Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when trying to npm install -g @aws-amplify/cli

new to this, I'm trying to install aws amplify from the command line and it keeps throwing me an err messages: I tried sudo, tried the safe route to no avail. I'm new to node and understanding dependencies etc. and not sure what I've done wrong!

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: [email protected]
npm ERR! node_modules/@aws-amplify/cli/node_modules/graphql
npm ERR!   graphql@"^14.5.8" from @aws-amplify/[email protected]
npm ERR!   node_modules/@aws-amplify/cli/node_modules/@aws-amplify/amplify-category-api
npm ERR!     @aws-amplify/amplify-category-api@"1.1.10" from @aws-amplify/[email protected]
npm ERR!     node_modules/@aws-amplify/cli
npm ERR!       @aws-amplify/cli@"*" from the root project
npm ERR!     @aws-amplify/amplify-category-api@"1.1.10" from [email protected]
npm ERR!     node_modules/@aws-amplify/cli/node_modules/amplify-container-hosting
npm ERR!       amplify-container-hosting@"2.4.10" from @aws-amplify/[email protected]
npm ERR!       node_modules/@aws-amplify/cli
npm ERR!         @aws-amplify/cli@"*" from the root project
npm ERR!   graphql@"^14.5.8" from @aws-amplify/[email protected]
npm ERR!   node_modules/@aws-amplify/cli/node_modules/@aws-amplify/graphql-auth-transformer
npm ERR!     @aws-amplify/graphql-auth-transformer@"0.5.7" from @aws-amplify/[email protected]
npm ERR!     node_modules/@aws-amplify/cli
npm ERR!       @aws-amplify/cli@"*" from the root project
npm ERR!     @aws-amplify/graphql-auth-transformer@"0.5.7" from [email protected]
npm ERR!     node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation
npm ERR!       amplify-provider-awscloudformation@"5.8.7" from @aws-amplify/[email protected]
npm ERR!       node_modules/@aws-amplify/cli
npm ERR!         @aws-amplify/cli@"*" from the root project
npm ERR!       2 more (@aws-amplify/amplify-category-api, amplify-util-mock)
npm ERR!     1 more (@aws-amplify/graphql-relational-transformer)
npm ERR!   88 more (amplify-app, amplify-codegen, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer graphql@"^15.0.0" from [email protected]
npm ERR! node_modules/@aws-amplify/cli/node_modules/amplify-codegen-appsync-model-plugin/node_modules/@graphql-codegen/visitor-plugin-common/node_modules/relay-compiler
npm ERR!   relay-compiler@"12.0.0" from @graphql-tools/[email protected]
npm ERR!   node_modules/@aws-amplify/cli/node_modules/amplify-codegen-appsync-model-plugin/node_modules/@graphql-codegen/visitor-plugin-common/node_modules/@graphql-tools/relay-operation-optimizer
npm ERR!     @graphql-tools/relay-operation-optimizer@"^6.3.7" from @graphql-codegen/[email protected]
npm ERR!     node_modules/@aws-amplify/cli/node_modules/amplify-codegen-appsync-model-plugin/node_modules/@graphql-codegen/visitor-plugin-common
npm ERR!       @graphql-codegen/visitor-plugin-common@"^2.5.1" from [email protected]
npm ERR!       node_modules/@aws-amplify/cli/node_modules/amplify-codegen-appsync-model-plugin
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.
like image 779
Vinh Le Avatar asked Oct 31 '25 18:10

Vinh Le


1 Answers

run npm install -g npm@latest

and after that try installing amplify-cli again.

like image 63
rorrry Avatar answered Nov 03 '25 08:11

rorrry