Skip to content

Commit

Permalink
Adding React 18 to the peerDependencies
Browse files Browse the repository at this point in the history
Adding React 18 into the mix as the dependencies were locked to v16 or v17. I got the following error when trying to install the module on a NextJS React 18 project

```
> npm install --save moment react-moment
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: personal-site-ts@0.1.0
npm ERR! Found: react@18.0.0
npm ERR! node_modules/react
npm ERR!   react@"18.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.0 || ^17.0.0" from react-moment@1.1.1
npm ERR! node_modules/react-moment
npm ERR!   react-moment@"*" 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.
```
  • Loading branch information
mrpbennett authored Apr 1, 2022
1 parent 9568de4 commit 3881ad0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"peerDependencies": {
"moment": "^2.29.0",
"prop-types": "^15.7.0",
"react": "^16.0 || ^17.0.0"
"react": "^16.0 || ^17.0.0 || ^18.0.0"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 3881ad0

Please sign in to comment.