question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot set property 'storybook' of undefined from npx -p @storybook/cli sb init

See original GitHub issue

I tried to follow the initial steps from here: https://www.learnstorybook.com/intro-to-storybook/react/en/get-started/

running:

npx create-react-app taskbox
cd taskbox

Then when I ran: npx -p @storybook/cli sb init

I get the error TypeError: Cannot set property 'storybook' of undefined

This is the full message in my terminal:

 sb init - the simplest way to add a storybook to your project. 

 • Detecting project type. ✓
 • Adding storybook support to your "Create React App" based project
     TypeError: Cannot set property 'storybook' of undefined
    at default (/Users/levelingup/.npm/_npx/2358/lib/node_modules/@storybook/cli/generators/REACT_SCRIPTS/index.js:29:33)
    at process._tickCallback (internal/process/next_tick.js:68:7)

running npx --version: 6.9.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
Manish-Giricommented, Dec 28, 2019

Hello, I would like to give this a shot…

2reactions
vikalp-sajwancommented, Jun 11, 2020

Hello all, this issue has been fixed, and is not reproducible anymore. It was fixed a long time back, but we can see the latest code that handles adding scripts to package.json here https://github.com/storybookjs/storybook/blob/next/lib/cli/src/js-package-manager/JsPackageManager.ts#L193,L200

@emileber, the no package.json issue is also not reproducible anymore. I believe, it was fixed in #8205 , more specifically, here, https://github.com/storybookjs/storybook/pull/8205/files#diff-8d17cc91321b260aaa782e8a42cd5634R69

Therefore, I think this issue can be closed. cc/ @shilman

Read more comments on GitHub >

github_iconTop Results From Across the Web

storybook cannot read properties of undefined ... - You.com
The TypeError: Cannot read properties of undefined (reading 'type') exception occurs in storybook when one defines the argTypes in the default export object ......
Read more >
CLI options - Storybook
Storybook comes with two CLI utilities: start-storybook and build-storybook . Storybook collects completely anonymous data to help us improve user experience.
Read more >
Storybook throwing errors - Stack Overflow
The error log is pointing out that your min-indent package may be missing from your node_modules folder for whatever reason. Error: Cannot ......
Read more >
MIGRATION.md - Storybook - Fossies
npx sb @next automigrate. The automigration suite also runs when you create a new project ( sb init ) or when you update...
Read more >
Getting Started With Storybook for Vue - Egghead.io
Storybook can help you develop UI components in an isolated area without ... TypeError: Cannot read property 'plugins' of undefined ERR! at ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found