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

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

Related

I do I resolve the package.jason file error?

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

Facing Issue while installing dependency issue in React project

I'm getting the following error when I attempt to install a new dependency in my React project:
C:\Users\abhinavverma Desktop Sodexo-Fe Matchiq-fe> npm i #cypress/instrument-cra
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree,
npm ERR! npm ERR! While resolving: match-iq#0.1.0
npm ERR! Found: prettier#1. 19.1
npm ERR! node_modules/prettier
npm ERR! dev prettier#"^1.19.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer prettier#">=2.0.0" from pretty-quick#3.1.1 I
npm ERR! node_modules/pretty-quick
npm ERR! dev pretty-quick#"^3.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\abhinavverma 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\abhinavverma\AppData\Local\npm-cache_logs 2021-08-12T18_35_58_522Z-debug.log
run the command again with --force on the end. It can't find the correct version of the dependency. It looks like the version is wrong.

Dependencies installation error for React

While I am trying to install dependencies for the client, as below, the following errors were shown. What does it mean and how can I resolve it?
npm install axios moment react-file-base64 redux redux-thunk
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.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^15.0.2" from react-file-base64#1.0.3
npm ERR! node_modules/react-file-base64
npm ERR! react-file-base64#"*" 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/owen/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
Answer from my comment:
react-file-base64 depends on react 15, but you depend on react 17. try: a) downgrading or b) running it with --force
The fix: run with --force

Facing problem including reactstrap in my web project

I am trying to install reactstrap in my react project using commands like "npm i reactstrap react react-dom" or "npm install --save reactstrap react react-dom" but getting error everytime.
I tried to search Stack Overflow but have not found a solution.
Please help.
I am getting the following error:
"npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: react#17.0.1
npm ERR! node_modules/react
npm ERR! peer react#">=16.3.2" from #restart/context#2.1.4
npm ERR! node_modules/#restart/context
npm ERR! #restart/context#"^2.1.4" from react-bootstrap#1.4.0
npm ERR! node_modules/react-bootstrap
npm ERR! react-bootstrap#"^1.4.0" from the root project
npm ERR! peer react#"*" from #testing-library/react#11.2.2
npm ERR! node_modules/#testing-library/react
npm ERR! #testing-library/react#"^11.2.2" from the root project
npm ERR! 9 more (prop-types-extra, react-bootstrap, react-dom, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"0.14.x || ^15.0.0 || ^16.0.0" from react-popper#1.3.7
npm ERR! node_modules/reactstrap/node_modules/react-popper
npm ERR! react-popper#"^1.3.6" from reactstrap#8.8.1
npm ERR! node_modules/reactstrap
npm ERR! reactstrap#"*" 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/shashikant/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/shashikant/.npm/_logs/2021-01-02T08_50_48_353Z-debug.log
(base) MacBook-Pro:confusion shashikant$ sudo npm install i reactstrip react react-dom
Password:
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/reactstrip - Not found
npm ERR! 404
npm ERR! 404 'reactstrip#*' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/shashikant/.npm/_logs/2021-01-02T08_56_31_508Z-debug.log"
I used "npm install --save-dev reactstrap react react-dom --force" and it solved my problem.

I want to add reactstrap and bootstrap to React Web Coding

I want to add reactstrap and bootstrap to React Web Coding.
In a new terminal window I typed npm install reactstrap and npm install bootstrap
and I get this error:
C:\reactcourse\intro>npm install reactstrap
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependenc
npm ERR!
npm ERR! Found: react#17.0.1
npm ERR! node_modules/react
npm ERR! peer react#"*" from #testing-libra
npm ERR! node_modules/#testing-library/reac
npm ERR! #testing-library/react#"^11.2.2"
npm ERR! peer react#"17.0.1" from react-dom
npm ERR! node_modules/react-dom
npm ERR! peer react-dom#"*" from #testing
npm ERR! node_modules/#testing-library/re
npm ERR! #testing-library/react#"^11.2.
npm ERR! react-dom#"^17.0.1" from the roo
npm ERR! 1 more (reactstrap)
npm ERR! 2 more (the root project, reactstr
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"0.14.x || ^15.0.0 || ^16
npm ERR! node_modules/reactstrap/node_modules
npm ERR! react-popper#"^1.3.6" from reactst
npm ERR! node_modules/reactstrap
npm ERR! reactstrap#"*" from the root pro
npm ERR!
npm ERR! Fix the upstream dependency conflict
npm ERR! this command with --force, or --lega
npm ERR! to accept an incorrect (and potentia
npm ERR!
npm ERR! See C:\Users\emrec\AppData\Local\npm
npm ERR! A complete log of this run can be fo
npm ERR! C:\Users\emrec\AppData\Local\npm
It's caused by the fact that reactstrap uses the v1 of react-popper which is not compatible with the version of react you use (#^17.0.1).
You should either consider using a minor version of react or as I would advise you, consider using another UI component library like material or another more "actual" UI lib.

Resources