Storybook for React tutorial, failing to install npx -p @storybook/cli sb init

Viewed 4199

Thanks for taking the time to look at my issue.

I am following the Storybook for React Tutorial;

Create our application:

npx create-react-app taskbox

cd taskbox

Add Storybook:

npx -p @storybook/cli sb init

When I run the npx -p @storybook/cli sb init command, it will fail to install and I receive this error.

npm ERR! Unexpected end of JSON input while parsing near '...NrtNqRHco5\nxlpsRMQzO'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\chris\AppData\Roaming\npm-cache\_logs\2020-07-10T04_11_36_303Z-debug.log
Install for [ '@storybook/cli@latest' ] failed with code 1

So it looks like a cache error, I have run yarn cache clean --force. I still have the same issue.

Any help would be great!

1 Answers

Had the same issue.

Do: yarn add @storybook/cli --dev in your project.

then: yarn sb init to initialize storybook in your project.

Related