VUE install - unable to resolve dependency tree - javascript

I pull my project from other computer, it works fine there, but when i npm install on this machine it got this error. can i have some clue about how to fix this and what I need to do to avoid this kind of problem in the future.
npm ERR! Found: vue#3.2.45
npm ERR! node_modules/vue
npm ERR! vue#"^3.2.45" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue#"^2.5.17" from element-ui#2.15.12
npm ERR! node_modules/element-ui
npm ERR! element-ui#"^2.4.5" 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've tried installing vue, update npm to v18, all requirement are supposed to be fulfilled

You are installing ElementUI version 2.15.12 - which supports only Vue version 2 but your Vue is version 3.
Either install ElementPlus or downgrage Vue 3 to Vue 2.

Related

Does new version of Gatsby not work with Material UI?

I am running into this error
portfolio % npm install gatsby-theme-material-ui
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: project#1.0.0
npm ERR! Found: gatsby#5.3.3
npm ERR! node_modules/gatsby
npm ERR! gatsby#"^5.3.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer gatsby#"^3.0.0 || ^4.0.0" from gatsby-theme-material-ui#5.3.0
npm ERR! node_modules/gatsby-theme-material-ui
npm ERR! gatsby-theme-material-ui#"*" from the root project
npm ERR!
Within my gatsby config I have the plugin but am noticing some weird styling for production. I assumed it was because it is missing something like gatsby-theme-material-ui for it to work.
Any ideas?
gatsby-theme-material-ui is not an official plugin so it's only maintained and supported by his author and contributors so its actual state is quite deprecated. This means that you are relying on Gatsby's package version which is expecting a version 3 or 4 (gatsby#"^3.0.0 || ^4.0.0") while you have the 5.3.3.
If looking for other alternative plugins is not an option, you can bypass the dependency tree issue by running:
npm install gatsby-theme-material-ui --legacy-peer-deps
The --legacy-peer-deps will resolve the (old) legacy dependencies for the package.

Problem in Installing Material ui with next js (with and without typescript) error [duplicate]

This question already has answers here:
Fix the upstream dependency conflict installing NPM packages
(15 answers)
Closed 11 months ago.
im new to react and next js so sorry for my idiotic question,
im trying to install material ui in a new next js app
(i used "npx create-next-app#latest"),
and im using the Material ui docs and the ts section
(https://mui.com/guides/typescript/#main-content)
i got the following error in cli / terminal:
npm install #mui/material #emotion/react #emotion/styled
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! peer react#">=16.8.0" from #emotion/react#11.8.2
npm ERR! node_modules/#emotion/react
npm ERR! #emotion/react#"*" from the root project
npm ERR! peerOptional #emotion/react#"^11.5.0" from #mui/material#5.5.3
npm ERR! node_modules/#mui/material
npm ERR! #mui/material#"*" from the root project
npm ERR! 1 more (#emotion/styled)
npm ERR! 1 more (#emotion/styled)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^17.0.0" from #mui/material#5.5.3
npm ERR! node_modules/#mui/material
npm ERR! #mui/material#"*" 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!
i have tried to use the material ui component and got a compiler error,
even though i have tried in a nextjs (without ts and with)
and with the flags: --force, or --legacy-peer-deps
please help! a lot of thanks in advance! i just need to start my project!
install material ui in next-js with and without typescript
If I had this problem I would have deleted package.json and installed it again and after that I try to install Material. Did you try this?
Run this command. Just worked for me.
npm install #mui/material #emotion/react #emotion/styled --force
I also deleted my node_modules and did another install to be sure. and it found 0 vulnerabilities.

How can I download and Use Angular project off of Stackblitz?

So I have a project available on stackblitz that I want to use offline for my own purposes. for reference, here is the link to what I want to use- https://stackblitz.com/edit/nvs-angular-search-dropdown-istnzp. So, I tried to download the code and planned to run it using npm install and ng serve. but I am getting lots of errors on running npm install saying like this:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: angular#0.0.0
npm ERR! Found: #angular/compiler#12.0.3
npm ERR! node_modules/#angular/compiler
npm ERR! #angular/compiler#"^12.0.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #angular/compiler#"7.0.4" from #angular/compiler-cli#7.0.4
npm ERR! node_modules/#angular/compiler-cli
npm ERR! dev #angular/compiler-cli#"~7.0.0" 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\cnaag\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\cnaag\AppData\Local\npm-cache\_logs\2021-06-06T10_39_43_617Z-debug.log
Any help in this regard would be amazing!
Instead of NPM, install Yarn on your machine and run yarn install

Library is not importing

I am trying to import the react-navigation library in my react native project.
But it is giving me this error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: IbexCrypto#0.0.1
npm ERR! Found: react#17.0.1
npm ERR! node_modules/react
npm ERR! react#"17.0.1" from the root project
npm ERR! peer react#"*" from #react-navigation/stack#5.14.3
npm ERR! node_modules/#react-navigation/stack
npm ERR! #react-navigation/stack#"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.0" from #react-native-community/masked-view#0.1.10
npm ERR! node_modules/#react-native-community/masked-view
npm ERR! peer #react-native-community/masked-view#">= 0.1.0" from #react-navigation/stack#5.14.3
npm ERR! node_modules/#react-navigation/stack
npm ERR! #react-navigation/stack#"*" 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\me\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\me\AppData\Local\npm-cache\_logs\2021-03-17T15_24_47_867Z-debug.log
It is also giving me the same error while I try to import some other libraries too.
Previously when I import the navigation library in my old project it works fine but now it is giving me this error.
Kindly, someone tells me why this error is showing. And how to resolve the issue and how to avoid the same problem in the future.
I will be very thankful if someone helps me as I am a relative beginner in development and do not know the logic of this error.
use commond
npm install #react-navigation/native
for import the react-navigation library
You have a dependency conflict! It means that you have an incorrect and potentially broken dependency.
Try this first:
rm -rf node_modules/
npm install
This command removes the node_modules folder and then installs the dependencies you have in your package.json
If it doesn't work, try to run npm install with the command --force or --legacy-peer-deps.
In your case:
npm install #react-navigation/native --force
or: npm install #react-navigation/native --legacy-peer-deps
Description of the commands:
--force: forces npm install to install the dependencies you want to install.
-legacy-peer-deps: --legacy-peer-deps: ignore all peerDependencies when installing.
These commands it's necessary in some cases but as standard npm install should be enough to install the dependencies from your package.json file.
For your issues, this two command may works
npm install --legacy-peer-deps
or
npm install --force
React navigation command in version 3 and 4
npm install —-save react-navigation
There are some minor changes in navigation 4
React navigaiton
React navigation command in version 5
npm install #react-navigation/native
You can import like below code
import { createAppContainer } from "react-navigation";
please refer official docs for react-navigation and install all the necessery dependency from here:
https://reactnavigation.org/docs/getting-started
after installing dependency run
react-native start --reset-cache
and then
react-native run-android

issue installing npm package, react-circular-progressbar

When I install react-circular-progressbar into my react projects it show an error why?
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: nadeems-portfolio#0.1.0
npm ERR! Found: react#17.0.1
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#"^0.14.0 || ^15.0.0 || ^16.0.0" from react-circular-progressbar#2.0.3
npm ERR! node_modules/react-circular-progressbar
npm ERR! react-circular-progressbar#"*" 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 /home/nadeem/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/nadeem/.npm/_logs/2020-12-05T09_58_59_238Z-deb
This is because one of the depencies can not be resolved combined with your current dependencies.
The following part indicates that ciruclar-progressbar (version 2.0.3) requires react 15 or 16 as a peer dependency, and you are using a newer version in your dependency list.
Could not resolve dependency: peer react#"^0.14.0 || ^15.0.0 || ^16.0.0" from react-circular-progressbar#2.0.3
There are a few solutions;
Downgrade the package that doesn't fit in the constraints of the package that you want to install
Look for a version of the package that you are trying to install that has updated their peer dependencies to include react 17
use npm install <package-name> --force to ignore it (really not recommended, unless you have manually verified there are no incompatibilities)
use npm install <package-name> --legacy-peer-deps.
The first two options are deduced from the error you have given. Whereas the last two options are provided in the error itself.

Categories