styled-components / babel-plugin-styled-components

Improve the debugging experience and add server-side rendering support to styled-components
MIT License
1.07k stars 139 forks source link

Npm error while installing latest version (v6.0.0-rc.6) #394

Open enoh-barbu opened 1 year ago

enoh-barbu commented 1 year ago
npm ERR! Found: styled-components@6.0.0-rc.6
npm ERR! node_modules/styled-components
npm ERR!   styled-components@"^6.0.0-rc.6" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer styled-components@">= 2" from babel-plugin-styled-components@2.1.4
npm ERR! node_modules/babel-plugin-styled-components
npm ERR!   dev babel-plugin-styled-components@"^2.1.4" from the root project
npm ERR!   peerOptional babel-plugin-styled-components@">= 2" from styled-components@6.0.0-rc.6
npm ERR!   node_modules/styled-components
npm ERR!     styled-components@"^6.0.0-rc.6" 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.

What I'm doing wrong? just tried to install the lastest version

ycytt-rs commented 1 year ago

from a fresh npm project:

npm i react styled-components@6.0.0-rc.6 babel-plugin-styled-components
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: babel-plugin-styled-components@2.1.4
npm ERR! Found: styled-components@6.0.0-rc.6
npm ERR! node_modules/styled-components
npm ERR!   styled-components@"6.0.0-rc.6" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer styled-components@">= 2" from babel-plugin-styled-components@2.1.4
npm ERR! node_modules/babel-plugin-styled-components
npm ERR!   babel-plugin-styled-components@"*" from the root project
npm ERR!   peerOptional babel-plugin-styled-components@">= 2" from styled-components@6.0.0-rc.6
npm ERR!   node_modules/styled-components
npm ERR!     styled-components@"6.0.0-rc.6" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: styled-components@5.3.11
npm ERR! node_modules/styled-components
npm ERR!   peer styled-components@">= 2" from babel-plugin-styled-components@2.1.4
npm ERR!   node_modules/babel-plugin-styled-components
npm ERR!     babel-plugin-styled-components@"*" from the root project
npm ERR!     peerOptional babel-plugin-styled-components@">= 2" from styled-components@6.0.0-rc.6
npm ERR!     node_modules/styled-components
npm ERR!       styled-components@"6.0.0-rc.6" 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.

I guess we need to fix peerDependencies in package.json