Storybook: issue installing storybook-vue with npx

Created on 30 Apr 2019  Â·  3Comments  Â·  Source: storybookjs/storybook

Describe the bug
Storybook For Vue guide: https://storybook.js.org/docs/guides/guide-vue/ describes the following one step to install storybook-vue

npx -p @storybook/cli sb init --type vue

However, it fails with following error:

╰─$ npx -p @storybook/cli sb init --type vue
npx: installed 408 in 25.041s

WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option.

You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands:

  npm install --save core-js@2    npm install --save core-js@3
  yarn add core-js@2              yarn add core-js@3

[BABEL] Note: The code generator has deoptimised the styling of /Users/izl334/.npm/_npx/41992/lib/node_modules/@storybook/cli/node_modules/lodash/lodash.js as it exceeds the max of 500KB.

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

 • Installing Storybook for user specified project type. ✓
 • Adding storybook support to your "Vue" app
     TypeError: Cannot create property 'dependencies' on boolean 'false'
    at _callee$ (/Users/izl334/.npm/_npx/41992/lib/node_modules/@storybook/cli/generators/VUE/index.js:33:3)
    at call (/Users/izl334/.npm/_npx/41992/lib/node_modules/@storybook/cli/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.tryCatch [as _invoke] (/Users/izl334/.npm/_npx/41992/lib/node_modules/@storybook/cli/node_modules/regenerator-runtime/runtime.js:288:22)
    at Generator._invoke [as next] (/Users/izl334/.npm/_npx/41992/lib/node_modules/@storybook/cli/node_modules/regenerator-runtime/runtime.js:114:21)
    at asyncGeneratorStep (/Users/izl334/.npm/_npx/41992/lib/node_modules/@storybook/cli/generators/VUE/index.js:36:103)
    at _next (/Users/izl334/.npm/_npx/41992/lib/node_modules/@storybook/cli/generators/VUE/index.js:38:194)
    at process._tickCallback (internal/process/next_tick.js:68:7)

To Reproduce
Steps to reproduce the behavior:

  1. Go to ' https://storybook.js.org/docs/guides/guide-vue/'
  2. Install with step provided: npx -p @storybook/cli sb init --type vue
  3. See error

Screenshots
Screen Shot 2019-04-30 at 3 24 29 PM

System:

  • OS: MacOS Mojave(10.14.4)
  • Device: [Macbook Pro 2016]
  • Browser: [N/A]
  • Framework: [vue]
  • Addons: [if relevant]
  • Version: [5]

Additional context
node v10.14.2
npm v6.4.1

vue cli question / support

Most helpful comment

if you are using vue-cli, i recommend installing storybook via vue-cli-plugin-storybook

All 3 comments

@vikikamath Do you have a package.json in the folder you're running this in? if not, you should? storybook is meant to run in a currently existing vue project, not to create a new one from scratch.

if you are using vue-cli, i recommend installing storybook via vue-cli-plugin-storybook

Thanks guys! vue-cli-plugin-storybook worked like a charm!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dnlsandiego picture dnlsandiego  Â·  3Comments

tirli picture tirli  Â·  3Comments

arunoda picture arunoda  Â·  3Comments

levithomason picture levithomason  Â·  3Comments

zvictor picture zvictor  Â·  3Comments