Open Yuisei-Maruyama opened 2 years ago
npm install react react-dom
を実行した時に下記のような問題に遭遇し、react
と react-dom
が最新にならなかった。。
pm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: @scope/my-portfolio-client@0.0.1
npm ERR! Found: react@18.1.0
npm ERR! node_modules/react
npm ERR! react@"18.1.0" from the root project
npm ERR! peer react@">= 16.8.0" from styled-components@5.3.5
npm ERR! node_modules/styled-components
npm ERR! styled-components@"^5.3.5" from the root project
npm ERR! peer styled-components@">= 2" from babel-plugin-styled-components@2.0.7
npm ERR! node_modules/babel-plugin-styled-components
npm ERR! dev babel-plugin-styled-components@"^2.0.7" from the root project
npm ERR! 1 more (styled-components)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.2" from react-dom@17.0.2
npm ERR! node_modules/react-dom
npm ERR! react-dom@"^17.0.2" from the root project
npm ERR! peer react-dom@">= 16.8.0" from styled-components@5.3.5
npm ERR! node_modules/styled-components
npm ERR! styled-components@"^5.3.5" from the root project
npm ERR! 1 more (babel-plugin-styled-components)
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 install react@latest react-dom@latest
を実行することで解決されたように思える。
外部プロジェクトとの干渉をなくす目的で React のバージョン(v18.1.0)を最新版に置き換える。