Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upTypeError: Cannot set property 'storybook' of undefined from npx -p @storybook/cli sb init #9243
Comments
|
Are you sure you're running that inside the |
Yup, i was in the directory when I ran |
|
The line that errored is trying to add something to the |
|
No scripts field. Only thing in my
|
|
I encountered the same problem. The problem was solved after I uninstalled the global create-react-app package. |
|
I think the CLI should be smart enough to add a |
|
Hello, I would like to give this a shot.. |
|
@Manish-Giri While you're at it, it would be great if the CLI failed gracefully when there is no
I think it comes from the following lines: const packageJson = await retrievePackageJson();
// missing a check here and a helpful error message.
packageJson.dependencies = packageJson.dependencies || {}; |


I tried to follow the initial steps from here: https://www.learnstorybook.com/intro-to-storybook/react/en/get-started/
running:
Then when I ran:
npx -p @storybook/cli sb initI get the error
TypeError: Cannot set property 'storybook' of undefinedThis is the full message in my terminal:
running
npx --version: 6.9.0