I do I resolve the package.jason file error? - reactjs

Why am I having the below error
PS C:\Users\USER\Desktop\Shareme\shareme_frontend> npm install #sanity/client #sanity/image-url react-google-login react-icons react-loader-spinner react-masonry-css react-router-dom uuid
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: shareme_frontend#0.1.0
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#"^16 || ^17" from react-google-login#5.2.2
npm ERR! node_modules/react-google-login
npm ERR! react-google-login#"*" 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\USER\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\USER\AppData\Local\npm-cache\_logs\2022-06-29T15_11_18_949Z-debug-0.log

react-google-login is not updated to the latest react v18.
Either wait for an update, downgrade react to v17, or use --force flag.
npm i react-google-login --force
Note that by using --force, there is no guarantee that this package will work with v18 of react

react-google-login#5.2.2 is not compatible with react 18 version as 5.2.2 is published year ago as per npm page.
It is still looking for react version of 17 / 16.
Below error block will tell you this:
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16 || ^17" from react-google-login#5.2.2
You can downgrade your react for this specific project via :
deleting node_modules
run npm cache clean
manually update your package.json to change version of react to 17
run npm install

Related

Installing react-redux-firebase package with React 18

I'm trying to install this package npm install --save react-redux-firebase for React and I'm getting this error “Could not resolve dependency: npm ERR! peer react#"^16.3.0 || ^17.0.0" from react-side-effect#2.1.1” I use 18.2 version of React
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: professional-resources#0.1.0
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#"^16.3.0 || ^17.0.0" from react-redux-firebase#3.11.0
npm ERR! node_modules/react-redux-firebase
npm ERR! react-redux-firebase#"*" 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 resoluti
on.
What can i do:
The problem is that this library does not support react 18 or if they support it they didn't add it as a peer deps: see
You have multiple solutions:
Downgrading to react 17
Asking library maintainers and help them to upgrade to react 18
Forcing versions with npm resolutions (Use it at your own risk as the library does not support react 18 inside their peerDeps)
try this instead:
npm install --legacy-peer-deps react-redux-firebase redux-firestore

Couldn't install Axios in React Native via npm install axios

I have done in React Js multiple times but it is my first time using axios in React Native. When I install axios through npm install axios it gives a huge log error related to other libraries .
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-native-location-view#0.3.0
npm ERR! Found: react-native-vector-icons#8.1.0
npm ERR! node_modules/react-native-vector-icons
npm ERR! peer react-native-vector-icons#">7.0.0" from react-native-elements#3.4.2
npm ERR! node_modules/react-native-elements
npm ERR! react-native-elements#"^3.4.2" from the root project
npm ERR! peer react-native-vector-icons#"*" from react-native-paper#4.9.2
npm ERR! node_modules/react-native-paper
npm ERR! react-native-paper#"^4.9.2" from the root project
npm ERR! 1 more (the root project)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-vector-icons#"^4.4.3" from react-native-location-view#0.3.0
npm ERR! node_modules/react-native-location-view
npm ERR! react-native-location-view#"^0.3.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react-native-vector-icons#4.6.0
npm ERR! node_modules/react-native-vector-icons
npm ERR! peer react-native-vector-icons#"^4.4.3" from react-native-location-view#0.3.0
npm ERR! node_modules/react-native-location-view
npm ERR! react-native-location-view#"^0.3.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\Suyash\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\Suyash\AppData\Local\npm-cache\_logs\2021-12-07T15_22_51_263Z-debug.log
It should have been same as React JS but for some reason these errors are appearing.
This isn't an issue with Axios your dependencies are conflicting because they're out-dated. For example:
Could not resolve dependency:
npm ERR! peer react-native-vector-icons#"^4.4.3" from react-native-location-view#0.3.0
which is trying to pull version 4 and React Native Vector Icons is on version 9. You should update your dependencies and check for any conflicting code accordingly. Would also suggest using Yarn with React Native.
You can run in the terminal:
rm node_modules && rm package-lock.json && yarn install
if you have Yarn installed. If as you stated everything works correctly you could try:
npm i react-native-location-view --legacy-peer-deps
or:
npm i --legacy-peer-deps

Material UI , Next12, React 18

I'm trying to try out the latest version of NextJS(version 12) to give my project access to SSR ServerComponents & Http streaming.
MaterialUI works fine with Next 12.0.7 and React 17 (installed using npx create-next-app#latest)
When I do
npm install react#beta react-dom#beta
Then
npm install #mui/material #mui/styled-engine-sc styled-components --save
Gives
(base) marcfielding#MBP meta-ui % npm install #mui/material #mui/styled-engine-sc styled-components --save
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: meta-ui#undefined
npm ERR! Found: react#18.0.0-rc.0-next-f2a59df48-20211208
npm ERR! node_modules/react
npm ERR! react#"^18.0.0-beta-24dd07bd2-20211208" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^17.0.2" from #mui/material#5.2.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!
npm ERR! See /Users/marcfielding/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/marcfielding/.npm/_logs/2021-12-09T16_48_20_688Z-debug.log
Is this just a wait for MUI to catch up? Or is there a release I can install I was following the instructions from here previously?
If you don't mind using yarn, here is a repo you can fork with the deps you want: https://github.com/MiniDeathStar/material-ui-next12-react-18
If you want to use npm, you can run:
npm install #mui/material #mui/styled-engine-sc styled-components --legacy-peer-deps
Mui shouldn't be broken by React#18. I've used them together just fine. Npm is a finicky package manager though, so I'll advocate for Yarn 3 whenever I get the chance.

Npm dependency issue: react 17.0.2 and "react-swipeable-views": "0.13.9"

I am trying to setup material dashboard from
git clone https://github.com/creativetimofficial/material-dashboard-react.git.
Using node-16
I run npm install
I get
npm ERR! While resolving: material-dashboard-react#1.10.0
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^15.3.0 || ^16.0.0" from react-swipeable-views#0.13.9
npm ERR! node_modules/react-swipeable-views
npm ERR! react-swipeable-views#"0.13.9" 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/simha/.npm/eresolve-report.txt for a full report.
How can I resolve this.
It looks like the root project installs react#17.0.2. But "react-swipeable-views" requires version 15 or 16 of react.
Edit: As a first option, you could try updating "react-swipeable-views" to its latest version. It may possibly support React 17.
The following command will update it.
npm install react-swipeable-views#latest
If this doesn't work...
Try reducing the numbers for react in the package.json to something in the 16.x.x range, then re-run
npm install
so it will satisfy the peer dependency.
https://docs.npmjs.com/about-semantic-versioning
If you're not familiar with NPM semantic versioning, use this calculator. Enter react -> "^16.0.0" to see that it does not include 17
https://semver.npmjs.com/

ERESOLVE unable to resolve dependency tree in react

Trying add dependencies react but i cannot install any packages. I recently deleted a package-lock.json to resolve ELOCKVERIFY error. I eventually installed the following command of 'npm audit fix' but I still carry the same ERESOLVE error.
npm audit fix
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: client#0.1.0
npm ERR! Found: react#17.0.2
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.0.0" from react-simple-typewriter#1.0.13
npm ERR! node_modules/react-simple-typewriter
npm ERR! react-simple-typewriter#"^1.0.13" 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\Owner\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\Owner\AppData\Local\npm-cache\_logs\2021-05-11T19_07_29_767Z-debug.log
react-simple-typewriter version 1.0.13 requires version 16.x, while you have version 17.0.2.
Either upgrade react-simple-typewriter to a version that supports React 17.x (if there is one) or downgrade React to 16.x

Resources