'Error when trying to install react-redux-form
My NPM cannot install react-redux-form for my project. I need assistance, please.
C:\Users\folder>npm install react-redux-form@latest --save
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
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 [email protected]
npm ERR! node_modules/react-redux-form
npm ERR! react-redux-form@"1.16.14" 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\james\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\james\AppData\Local\npm-cache_logs\2022-03-01T03_50_51_548Z-debug.log
After compilation
Failed to compile
./src/components/ContactComponent.js
Module not found: Can't resolve 'react-redux-form' in 'C:\Users\dir\src\components'
This error occurred during the build time and cannot be dismissed.
My Jason file
"name": "james-react-website",
"version": "0.1.0",
"private": false,
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"devDependencies": {
"bootstrap": "^4.0.0",
"bootstrap-social": "^5.1.1",
"font-awesome": "^4.7.0",
"react-bootstrap": "^2.1.2",
"react-popper": "^0.9.2",
"react-router-dom": "^4.2.2",
"reactstrap": "^5.0.0",
"webpack": "^5.68.0"
},
"dependencies": {
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-redux": "^7.2.6",
"react-scripts": "^2.1.3",
"redux": "^3.7.2",
"redux-form": "^8.3.8",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.2.0",
"web-vitals": "^2.1.4"
},
Solution 1:[1]
If you are using the latest Node v15 and npm v7 releases, npm install redux-form will fail.
I believe this is due to some changes in NPM. Can read more about it here.
If you're using NPM, run this command instead:
npm install redux-form --legacy-peer-deps
Hope this solves your issue!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | cwar |
