react-router peerDependencies error - reactjs

I'm trying to install react-router but I get the following error.
$ npm install react-router
npm WARN peerDependencies The peer dependency react#0.13.x included from react-router will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "react-router"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code EPEERINVALID
npm ERR! peerinvalid The package react does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer react-addons-test-utils#0.14.0-rc1 wants react#^0.14.0-rc1
npm ERR! peerinvalid Peer react-router#0.13.4 wants react#0.13.x
npm ERR! peerinvalid Peer react-bootstrap#0.25.2 wants react#>=0.13
npm ERR! Please include the following file with any support request:
npm ERR! C:\ReactApps\good start\npm-debug.log
The package.json for react in node-modules shows that I use:
"version": "0.14.0-rc1",
Should I install an earlier version? It seems that 0.13.x might be a better supported version?
If that is the case, how can I install without messing up my current project?
After using
npm install npm -g
I typed npm -v and saw that the version in my project is still 2.11.13.
I figured that it might be a local version of NPM so I typed:
npm install npm
hoping to get the latest version updated locally, but still got 2.11.13 when I checked for the version.
comp-asus XXX64 /c/ReactApps/goodRouter/goodrouter (master)
$ npm -v
2.11.3
comp-asus XXX64 /c/ReactApps/goodRouter/goodrouter (master)
$ npm install react-router
npm WARN peerDependencies The peer dependency react#0.13.x included from react-router will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "react-router"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code EPEERINVALID
npm ERR! peerinvalid The package react does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer react-router#0.13.4 wants react#0.13.x
npm ERR! Please include the following file with any support request:
npm ERR! C:\ReactApps\goodRouter\goodrouter\npm-debug.log
When checking globally I can see that it is updated:
$ npm list -g --depth=0
C:\Users\Roger\AppData\Roaming\npm
├── babel-eslint#4.1.3
├── bower#1.5.2
├── eslint#1.5.1
├── findup-sync#0.2.1
├── generator-angular#0.12.1
├── generator-karma#1.0.0
├── generator-meanjs#0.1.12
├── generator-polymer#1.1.0
├── generator-react-boilerplate#0.1.9
├── generator-react-webpack#1.2.12
├── grunt-cli#0.1.13
├── gulp#3.9.0
├── httpster#1.0.1
├── jspm#0.16.10
├── jsxhint#0.15.1
├── live-server#0.8.1
├── mean-cli#0.10.14
├── mocha#2.2.5
├── node-gyp#2.0.2
├── npm#3.3.5
├── react-tools#0.13.3
├── superstatic#2.2.1
├── tsd#0.6.4
├── typescript#1.7.0-dev.20150921 invalid
├── webpack#1.12.2
└── yo#1.4.7
But how do I use the global version in the project?
So the problem persists but I do believe you put me on the right track.
$ where npm
C:\Program Files\nodejs\npm
C:\Program Files\nodejs\npm.cmd
C:\Users\Roger\AppData\Roaming\npm\npm
C:\Users\Roger\AppData\Roaming\npm\npm.cmd
So I should delete one of these?

This is one of the major issues solved in npm#3. See https://github.com/npm/npm/issues/6565 for details.
Updating npm is the right thing to do:
$ npm install npm -g

Related

Update the library in package.json

I want to update the libraries in package.json in a batch, so I executed the command ② after executing the command ①.
After that, I executed the yarn command and the libraries were installed, but when I executed npm install after executing the commands (1) and (2), I got an error.
Why does npm install give me an error?
①rm -rf node_modules yarn.lock
② npx npm-check-updates -u
error
npm ERR! react#"18.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.8.0 || ^17.0.0" from #material-ui/core#4.12.4
npm ERR! node_modules/#material-ui/core
npm ERR! #material-ui/core#"^4.12.4" 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 /user/.npm/eresolve-report.txt for a full report.
you have a dependency conflict in your packages.
#material-ui/core#4.12.4 needs react 16/17 but you are using react 18
upgrade to material-ui v5
OR
use --force flag knowing that there may be some breaking changes
npm install --force

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

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/

UNMET PEER DEPENDENCY react

I have errors when want to install npm install node-saas
├── UNMET PEER DEPENDENCY react#15.4.2
└── UNMET PEER DEPENDENCY react-dom#15.4.2
npm ERR! peer dep missing: react#^0.14.1, required by
react-select#0.9.1
npm ERR! peer dep missing: react-dom#^0.14.1, required by
react-select#0.9.1
npm ERR! code 1
Please help, Thank you very much.
I think you forgot to install react and react-dom, first run this command it will install react and react-dom properly with all dependencies, after that run other commands.
npm install react react-dom --save
By using --save it will make a entry in package.json file, after using above command check your package.json file, these entries will be there:
"react": "^XX.X.X",
"react-dom": "^XX.X.X",

I want to enable intellisense for angular 1.6 in VS code . Getting error while installing angular with typings

I am getting the following error.
typings install dt~angular --global typings ERR! message Attempted to compile "angular" as a global module, but it l ooks like an external module. You'll need to remove the global option to continu e. typings ERR! typings ERR! cwd C:\Users\Debjit typings ERR! system Windows_NT
6.2.9200 typings ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Debjit\\A ppData\\Roaming\\npm\\node_modules\\typings\\dist\\bin.js" "install" "dt~angular " "--global" typings ERR! node -v v6.9.1 typings ERR! typings -v 2.1.0 typings ERR! typings ERR! If you need help, you may report this error at: typings ERR! <https://github.com/typings/typings/issues>
While the follwing modules are there
npm list -g --depth=0
+-- bower#1.7.9
+-- cordova#6.1.1
+-- gulp#3.9.1
+-- ionic#1.7.14
+-- typescript#2.1.4
`-- typings#2.1.0

Resources