D
D
Daniel Newman2021-04-04 09:10:20
npm
Daniel Newman, 2021-04-04 09:10:20

How to start a storybook in a CRA project with npm?

There is a problem, two years old: react-scripts included in CRA relies on a different version babel-loader 8.1.0 dependency in Storybook @storybook/addon-docs module dependencies.

There are two ways out of this problem that are unacceptable for me: yarn - solves the problem through resolutions in package.json, there is no such solution in npm and all that remains is to silence the error message in order to pass the react-scripts test in CI.

Considering that the problem has already been raised hundreds of times in both the cra and storybook communities, I'm interested in the experience of those who encountered this problem and overcame it without changing npm to yarn, and did not turn off a whole class of error notifications when building a project.

References:
https://github.com/storybookjs/storybook/issues/5183

The main search for a solution fits into the search for babel-loader, npm, storybook. Somehow, magically, this problem is from 2019, which hints to me that I don't know how to cook npm and storybook.

I will be glad to your ideas. Changing npm to yarn or suppressing errors is not good. I would like to find a solution!

Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question