Understanding peer dependency error for an npm package - reactjs

I'm trying to understand a peer dependency error from an npm package.
The error:
Could not resolve dependency:
peer react#"^18.2.0" from react-test-renderer#18.2.0
node_modules/react-test-renderer
dev react-test-renderer#"^18.2.0" from the root project
peer react-test-renderer#">=16.0.0" from #testing-library/jest-native#5.1.2
node_modules/#testing-library/jest-native
dev #testing-library/jest-native#"*" from the root project
I understand that #testing-library/jest-native#5.1.2 depends on react-test-renderer#">=16.0.0" - basically a version of react-test-renderer equal or higher than version 16.0.0. So why am I getting this peer dependency error if the package version installed fulfills the requirement?

Related

React Bootstrap application not running

I am trying to run my react bootstrap app with the command npm start, however this error appears
#babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining#7.14.5 requires a peer of #babel/core#^7.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap#5.0.0-alpha1 requires a peer of popper.js#^1.16.0 but none is installed. You must install peer dependencies yourself.
This is my package.json: https://hastebin.com/saforuvocu.json

React-webcam not getting added to my react project

I did the following to install react-webcam,
sudo npm install -g --save react-webcam
npm WARN react-webcam#3.0.1 requires a peer of react#>=15.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-webcam#3.0.1 requires a peer of react-dom#>=15.3.0 but none is installed. You must install peer dependencies yourself.
+ react-webcam#3.0.1
added 1 package from 1 contributor in 0.351s
but it wasnt added to the dependencies in package.json, So how can I add it to the node modules?

error while installing node modules for react application

I'm new to reactjs , while installing the this package I'm getting
this following error
npm install react-router-dom
npm WARN ajv-keywords#3.2.0 requires a peer of ajv#^6.0.0 but none is installed. You must install peer dependencies yourself.

How do I fix peer dependency errors?

I have an Angular project I began using a random starter project. Someone on our team attempted to clone the repo and when they did an npm install the application would not build and was giving the following errors:
npm WARN #angular/router#3.2.0 requires a peer of #angular/upgrade#2.2.0 but none was installed.
npm WARN codelyzer#1.0.0-beta.3 requires a peer of #angular/compiler#~2.1.1 but none was installed.
npm WARN codelyzer#1.0.0-beta.3 requires a peer of #angular/core#~2.1.1 but none was installed.
npm WARN app#0.0.0 No repository field.
It says angular router requires angular 2.2.0. So I manually install angular 2.2.0 and then I get the following error:
npm WARN codelyzer#1.0.0-beta.3 requires a peer of #angular/compiler#~2.1.1 but none was installed.
npm WARN codelyzer#1.0.0-beta.3 requires a peer of #angular/core#~2.1.1 but none was installed.
Now codelyzer reacquires the version of angular that I just upgrading from. I can easily go to the starter project and update my files but that is not going to help me to learn how to fix this issue.
How does one go about correcting what seems to be a circular dependency problem when you fix one issue only to cause another?

Error Installing React

Whenever I do a npm init then npm install react - I get this error
── UNMET PEER DEPENDENCY react#15.3.0
npm WARN baobab-react#0.1.1 requires a peer of react#>=0.13.0 <1.0.0 but none was installed.
npm WARN fixed-data-table#0.4.7 requires a
peer of react#>=0.13.0 <0.15.0 || ^0.14.0-beta3 but none was
installed.
npm WARN react-native#0.30.0 requires a peer of
react#~15.2.0 but none was installed.
npm WARN react-router#0.13.5
requires a peer of react#0.13.x||0.14.x but none was installed. npm
ERR! code 1
This is my node v6.3.0 annd npm 3.10.3 versions.
npm install react --no-optional
Inside your project directory, can you please first run the following commands:-
1) rm -rf node_modules
2) Try installig react again now and other packages which are in your package.json file.

Resources