Conflicting upstream dependencies - node.js

I have no idea what I need to do to get NPM install to run successfully after upgrading Node to 18.12.1 and npm to 9.2.0. I keep getting this upstream dependency error. I ran
npm install -g npm-check-updates
ncu -u
npm install
And now this is where I am.
npm install ─╯
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: hipersigno#undefined
npm ERR! Found: react#18.2.0
npm ERR! node_modules/react
npm ERR! react#"^18.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^17.0.0" from react-svgmt#1.2.0
npm ERR! node_modules/react-svgmt
npm ERR! react-svgmt#"^1.2.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!
npm ERR! For a full report see:
npm ERR! /Users/mchildress/.npm/_logs/2023-01-09T16_27_29_875Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mchildress/.npm/_logs/2023-01-09T16_27_29_875Z-debug-0.log

What's going on is that react-svgmt has react 17 set as a peer dependency. This means that it is built only to support react 17. You have react 18 installed and npm sees that conflict and bails. You have the following options:
Downgrade to React 17 by using npm install --save react#^17.0.0 react-dom#^17.0.0
Indicate that you are okay with having a potentially incompatible version by using npm install --legacy-peer-deps.

Related

npm run dev not working with webpack/babel conflict

I am trying to run npm run dev for a Vue project but I keep getting the following output:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: babel-loader#7.1.5
npm ERR! Found: webpack#5.75.0
npm ERR! node_modules/webpack
npm ERR! peer webpack#"^5.0.0" from css-loader#6.7.2
npm ERR! node_modules/css-loader
npm ERR! dev css-loader#"^6.7.2" from the root project
npm ERR! peer webpack#"^5.20.0" from html-webpack-plugin#5.5.0
npm ERR! node_modules/html-webpack-plugin
npm ERR! dev html-webpack-plugin#"^5.5.0" from the root project
npm ERR! 8 more (postcss-loader, terser-webpack-plugin, url-loader, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack#"2 || 3 || 4" from babel-loader#7.1.5
npm ERR! node_modules/babel-loader
npm ERR! dev babel-loader#"^7.1.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: webpack#4.46.0
npm ERR! node_modules/webpack
npm ERR! peer webpack#"2 || 3 || 4" from babel-loader#7.1.5
npm ERR! node_modules/babel-loader
npm ERR! dev babel-loader#"^7.1.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.
I have no idea what to do, I have tried uninstalling vue-cli and tried re-installing it (I'm not sure if this messed up my packages). Is there a way to cleanly delete everything and start fresh? If anyone can help that would be much appreciated!
Update:
I tried starting a new project with vue init webpack frontend in a new folder and tried installing axios and am getting the following error
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: vuex#4.1.0
npm ERR! Found: vue#2.7.14
npm ERR! node_modules/vue
npm ERR! vue#"^2.5.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue#"^3.2.0" from vuex#4.1.0
npm ERR! node_modules/vuex
npm ERR! vuex#"^4.1.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: vue#3.2.45
npm ERR! node_modules/vue
npm ERR! peer vue#"^3.2.0" from vuex#4.1.0
npm ERR! node_modules/vuex
npm ERR! vuex#"^4.1.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.
I recently updated my version of node (v19.1.0) and npm (v8.19.3), could that be an issue? It generally seems like I am getting a bunch of conflicts every time I try to install new packages. Is there a way to just start clean?
Probably one of your packages is outdated, according to the error. I guess it's the babel loader.
Method 1 Upgrading or Updating your packages might solve the dependency error.
Method 2 Try running npm install --force or npm install --legacy-peer-deps. It should work.

REACT NATIVE - Can't install Realm Sync - Expo version 44

I want to create a mobile app with React Native. I am using Expo and I want to use Realm Sync as my DB.
Info:
Im working on vs code (on mac)
Node.js version: 16.18.0
React version: 18.2.0
React native version: 0.69.6
npm 8.19.0
Problem:
We have installed Expo version 44 (because a later or earlier version of Expo does not match with realm), but can still not install Realm Sync. When I run
"npm install realm", I get the error below:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: realm#11.0.0
npm ERR! Found: react-native#0.69.6
npm ERR! node_modules/react-native
npm ERR! peer react-native#"*" from #react-native-community/cli#8.0.6
npm ERR! node_modules/#react-native-community/cli
npm ERR! #react-native-community/cli#"^8.0.4" from react-native#0.69.6
npm ERR! react-native#"0.69.6" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional react-native#">=0.70.0" from realm#11.0.0
npm ERR! node_modules/realm
npm ERR! realm#"*" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react-native#0.70.4
npm ERR! node_modules/react-native
npm ERR! peerOptional react-native#">=0.70.0" from realm#11.0.0
npm ERR! node_modules/realm
npm ERR! realm#"*" 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.
We have followed severol tutorials. One of them are Quick start with Sync
We are obviously missing something.
Can someone please help?
Try it: npm install realm#10.6.0

Tried to install React-native-maps and I got this error what does this mean?

Terminal
npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency
tree npm ERR! npm ERR! While resolving: instalawnrn#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#">= 16.0 ||
< 17.0" from react-native-maps#0.28.0 npm ERR!
node_modules/react-native-maps npm ERR! react-native-maps#"" from
the root project npm ERR! 2 more (react-native, react-native-web)
npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer
react#"17.0.2" from react-dom#17.0.2 npm ERR! node_modules/react-dom
npm ERR! peer react-dom#">=16.5.1" from react-native-web#0.11.7 npm
ERR! node_modules/react-native-web npm ERR! peer
react-native-web#"^0.11" from react-native-maps#0.28.0 npm ERR!
node_modules/react-native-maps npm ERR! react-native-maps#""
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\kcopu\AppData\Local\npm-cache\eresolve-report.txt for a full
report.
The package manager can determine whether or not react-native-maps will be installed. NPM does not work but you can install the package with yarn for example 'yarn add react-native-maps' will work instead of npm Install.
You can do
npm i --legacy-peer-deps
Node packages after this command will be installed perfectly!
I am the same issue.
If I install with this command
npm install react-native-maps --save-exact
not work... but with this command
expo install react-native-maps
works!!

npm chakra-ui install failing due to dependency conflicts

I'm trying to learn react/typescript and I'm following a tutorial line for line, but somehow getting this error when trying to install either #chakra-ui/react or #chakra-ui/core. It seems like a dependecy issue with react having been updated. Should I rollback react?
kyoudai.industries git:(master) ✗ npm install #chakra-ui/react framer-motion
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: kyoudai.industries#1.0.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! peer react#"16.x || 17.x" from #chakra-ui/react#1.0.1
npm ERR! node_modules/#chakra-ui/react
npm ERR! #chakra-ui/react#"*" from the root project
npm ERR! 2 more (#emotion/react, #emotion/styled)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.8" from framer-motion#2.9.4
npm ERR! node_modules/framer-motion
npm ERR! framer-motion#"*" from the root project
npm ERR! peer framer-motion#"^2.9.4" from #chakra-ui/react#1.0.1
npm ERR! node_modules/#chakra-ui/react
npm ERR! #chakra-ui/react#"*" 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 /Users/travis/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/travis/.npm/_logs/2020-11-24T22_38_57_297Z-debug.log
With this command you can solve the problem:
npm i #chakra-ui/react --legacy-peer-deps
I had the same issue but in Vue. I ran the following commands and it started working:
vue create test -p default && cd test && vue serve src/main.js,
It seems like it created a folder running some tests.
Then I ran: npm i -g #vue/cli-service-global..
Then: npm run serve-- to initiate the vue server.
Hopefully it gives you an idea how to solve that in React.
Good luck!

I've downloaded Angular 7 project while my global version is 11 so ng serve , ng update all of them give me errors like that

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: #angular-devkit/build-angular#0.12.4
npm ERR! node_modules/#angular-devkit/build-angular
npm ERR! dev #angular-devkit/build-angular#"~0.1100.5" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev #angular-devkit/build-angular#"~0.1100.5" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: #angular/compiler-cli#11.0.5
npm ERR! node_modules/#angular/compiler-cli
npm ERR! peer #angular/compiler-cli#"^11.0.0" from #angular-devkit/build-angular#0.1100.5
npm ERR! node_modules/#angular-devkit/build-angular
npm ERR! dev #angular-devkit/build-angular#"~0.1100.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.
Please try by using the below command :-
npm install --save-dev webpack-dev-server
Or
ng update #angular/cli #angular/core --allow-dirty --force
I solved the same problem downgrading npm to version 6
npm install -g npm#6.14.13
and then update Angular

Resources