When I execute
npx storybook@latest init
to set up Storybook (as result it modifies package.json)
then I’m unable to npm run the project because of:
Error: node_modules/@types/react-dom/node_modules/@types/react/index.d.ts:3139:14 - error TS2300: Duplicate identifier 'LibraryManagedAttributes'.
3139 type LibraryManagedAttributes<C, P> = C extends
~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/react/ts5.0/index.d.ts:3308:14
3308 type LibraryManagedAttributes<C, P> = C extends
~~~~~~~~~~~~~~~~~~~~~~~~
'LibraryManagedAttributes' was also declared here.
Tried several ways with no luck.
The new lines in package.json after executing npx storybook@latest init
are some new devDependencies:
"devDependencies": {
"@storybook/addon-essentials": "^7.6.3",
"@storybook/addon-interactions": "^7.6.3",
"@storybook/addon-links": "^7.6.3",
"@storybook/angular": "^7.6.3",
"@storybook/blocks": "^7.6.3",
"@storybook/test": "^7.6.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"storybook": "^7.6.3",
}
Is this a Storybook issue or Typescript and how to resolve it?
I tried to add
"overrides": {
"react": "^18.2.0"
}
as suggested after removing all node_modules – no luck.
P.S. No Yarn.
Any suggestions how to fix this issue?


