Error when trying to npm install -g #aws-amplify/cli - node.js

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: graphql#14.7.0
npm ERR! node_modules/#aws-amplify/cli/node_modules/graphql
npm ERR! graphql#"^14.5.8" from #aws-amplify/amplify-category-api#1.1.10
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/cli#7.6.8
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 amplify-container-hosting#2.4.10
npm ERR! node_modules/#aws-amplify/cli/node_modules/amplify-container-hosting
npm ERR! amplify-container-hosting#"2.4.10" from #aws-amplify/cli#7.6.8
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/graphql-auth-transformer#0.5.7
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/cli#7.6.8
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 amplify-provider-awscloudformation#5.8.7
npm ERR! node_modules/#aws-amplify/cli/node_modules/amplify-provider-awscloudformation
npm ERR! amplify-provider-awscloudformation#"5.8.7" from #aws-amplify/cli#7.6.8
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 relay-compiler#12.0.0
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/relay-operation-optimizer#6.4.1
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/visitor-plugin-common#2.5.2
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 amplify-codegen-appsync-model-plugin#1.24.4
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.

run npm install -g npm#latest
and after that try installing amplify-cli again.

Related

Stylint error on installing node_modules. Even while running npm start this error keep arrising

Whenever I try to install modules for the project it pops up an error for stylelint.
There is no error in code and even after removing stylelint I am unable to solve this issue
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: stylelint-custom-processor-loader#0.2.1
npm ERR! Found: stylelint#14.11.0
npm ERR! node_modules/stylelint
npm ERR! peer stylelint#"^14.10.0" from stylelint-config-recommended#9.0.0
npm ERR! node_modules/stylelint-config-recommended
npm ERR! dev stylelint-config-recommended#"9.0.0" from the root project
npm ERR! peer stylelint#"^13.0.0 || ^14.0.0" from vite-plugin-stylelint#3.0.7
npm ERR! node_modules/vite-plugin-stylelint
npm ERR! dev vite-plugin-stylelint#"^3.0.7" from the root project
npm ERR! 1 more (the root project)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer stylelint#"^8.0.0" from stylelint-custom-processor-loader#0.2.1
npm ERR! node_modules/stylelint-custom-processor-loader
npm ERR! dev stylelint-custom-processor-loader#"^0.2.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: stylelint#8.4.0
npm ERR! node_modules/stylelint
npm ERR! peer stylelint#"^8.0.0" from stylelint-custom-processor-loader#0.2.1
npm ERR! node_modules/stylelint-custom-processor-loader
npm ERR! dev stylelint-custom-processor-loader#"^0.2.1" 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.
npm ERR!
npm ERR! See C:\Users\nitin\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\nitin\AppData\Local\npm-cache\_logs\2022-11-13T11_31_25_207Z-debug-0.log

Cannot install under npm packages anymore

When I want to install something under npm then I get an error. I try to fix it so many ways but failed. Here is the error
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: undefined#undefined
npm ERR! Found: #nomiclabs/hardhat-ethers#0.3.0-beta.13
npm ERR! node_modules/#nomiclabs/hardhat-ethers
npm ERR! dev #nomiclabs/hardhat-ethers#"npm:hardhat-deploy-ethers" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev #nomiclabs/hardhat-waffle#"^2.0.3" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: #nomiclabs/hardhat-ethers#2.1.1
npm ERR! node_modules/#nomiclabs/hardhat-ethers
npm ERR! peer #nomiclabs/hardhat-ethers#"^2.0.0" from #nomiclabs/hardhat-waffle#2.0.3
npm ERR! node_modules/#nomiclabs/hardhat-waffle
npm ERR! dev #nomiclabs/hardhat-waffle#"^2.0.3" 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.
npm ERR!
npm ERR! See C:\Users\Mazhar\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Mazhar\AppData\Local\npm-cache\_logs\2022-09-11T23_40_30_606Z-debug-0.log
PS C:\Users\Mazhar\Documents\Alchemy-weekly\nft-marketplace-scratch>

Installing nest/terminus gives dependency tree error

Whenever I try to install nest/terminus
npm i #nestjs/terminus
I get the following error
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: typeorm#0.3.7
npm ERR! Found: ioredis#4.28.5
npm ERR! node_modules/ioredis
npm ERR! peer ioredis#"^4.0.0" from #nestjs-modules/ioredis#1.0.1
npm ERR! node_modules/#nestjs-modules/ioredis
npm ERR! #nestjs-modules/ioredis#"^1.0.1" from the root project
npm ERR! ioredis#"^4.28.5" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional ioredis#"^5.0.4" from typeorm#0.3.7
npm ERR! node_modules/typeorm
npm ERR! peertypeorm#"^0.3.0" from #nestjs/typeorm#8.1.4
npm ERR! node_modules/#nestjs/typeorm
npm ERR! #nestjs/typeorm#"^8.1.4" from the root project
npm ERR! typeorm#"^0.3.7" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: ioredis#5.2.1
npm ERR! node_modules/ioredis
npm ERR! peerOptional ioredis#"^5.0.4" from typeorm#0.3.7
npm ERR! node_modules/typeorm
npm ERR! peer typeorm#"^0.3.0" from #nestjs/typeorm#8.1.4
npm ERR! node_modules/#nestjs/typeorm
npm ERR! #nestjs/typeorm#"^8.1.4" from the root project
npm ERR! typeorm#"^0.3.7" 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.
I tried running the following command
npm install --save --legacy-peer-deps
it ran okay, but on repeating the terminus installation I got the same error. Any idea what I might be doing wrong?

Installing expo-cli: Could not resolve dependency:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: type-fest#0.5.2
npm ERR! node_modules/expo-cli/node_modules/type-fest
npm ERR! type-fest#"^0.5.2" from boxen#4.1.0
npm ERR! node_modules/expo-cli/node_modules/boxen
npm ERR! boxen#"4.1.0" from expo-cli#4.4.7
npm ERR! node_modules/expo-cli
npm ERR! expo-cli#"*" from the root project
npm ERR! boxen#"4.1.0" from xdl#59.0.37
npm ERR! node_modules/expo-cli/node_modules/xdl
npm ERR! xdl#"59.0.37" from expo-cli#4.4.7
npm ERR! node_modules/expo-cli
npm ERR! expo-cli#"*" from the root project
npm ERR! 1 more (#expo/dev-tools)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional type-fest#"^0.13.1" from #pmmmwh/react-refresh-webpack-plugin#0.3.3
npm ERR! node_modules/expo-cli/node_modules/#pmmmwh/react-refresh-webpack-plugin
npm ERR! #pmmmwh/react-refresh-webpack-plugin#"^0.3.3" from #expo/webpack-config#0.12.71
npm ERR! node_modules/expo-cli/node_modules/#expo/webpack-config
npm ERR! #expo/webpack-config#"0.12.71" from xdl#59.0.37
npm ERR! node_modules/expo-cli/node_modules/xdl
npm ERR! xdl#"59.0.37" from expo-cli#4.4.7
npm ERR! node_modules/expo-cli
npm ERR! 1 more (#expo/dev-tools)
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.
I tried using --force but it didn't work. I also tried using --legacy-peer-deps and that made it install but when I type expo init myapp it says:
bash: expo: command not found
What is the problem over here?
I had the same issue, but this command worked for me:
npm install --global expo-cli --legacy-peer-deps

Version Issue in integrating mobx-react in app

I received this error for my app sample-login-page while running npm update
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: sample-login-page#1.0.0
npm ERR! Found: mobx-react#5.4.4
npm ERR! node_modules/mobx-react
npm ERR! mobx-react#"5.4.4" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer mobx-react#"^4.3.5" from bernie-core#0.41.4
npm ERR! node_modules/bernie-core
npm ERR! peer bernie-core#">=0.24.7" from bernie-test-util#0.35.4
npm ERR! node_modules/bernie-test-util
npm ERR! dev bernie-test-util#"0.35.4" from the root project
npm ERR! peer bernie-core#">=0.25.0" from #gc/global-controls-store#0.1.3
npm ERR! node_modules/#gc/global-controls-store
npm ERR! #gc/global-controls-store#"^0.1.3" from the root project
npm ERR! 1 more (bernie-test-util)
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
After upgrading mobx-react by npm install mobx-react --save I came up with same errors.
After installing mobx-react with specifically required version npm i mobx-react#4.3.5. Below error is coming up
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: sample-login-page#1.0.0
npm ERR! Found: mobx#4.15.4
npm ERR! node_modules/mobx
npm ERR! mobx#"4.15.4" from the root project
npm ERR! peer mobx#"^3.4.1 || ^4.0.0" from bernie-core#0.41.4
npm ERR! node_modules/bernie-core
npm ERR! peer bernie-core#">=0.24.7" from bernie-test-util#0.35.4
npm ERR! node_modules/bernie-test-util
npm ERR! dev bernie-test-util#"0.35.4" from the root project
npm ERR! peer bernie-core#">=0.25.0" from #gc/global-controls-store#0.1.3
npm ERR! node_modules/#gc/global-controls-store
npm ERR! #gc/global-controls-store#"^0.1.3" from the root project
npm ERR! 1 more (bernie-test-util)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer mobx#"^2.6.3 || ^3.0.0" from mobx-react#4.3.5
npm ERR! node_modules/mobx-react
npm ERR! mobx-react#"4.3.5" from the root project
npm ERR! peer mobx-react#"^4.3.5" from bernie-test-util#0.35.4
npm ERR! node_modules/bernie-test-util
npm ERR! dev bernie-test-util#"0.35.4" from the root project
npm ERR! 2 more (#gc/global-controls-store, bernie-core)
Can someone help me out with suggestions around this?
You can run this :
npm install mobx-react --save --legacy-peer-deps

Resources