Storybook: error: unknown option `--metro-config' when integrating with react native typescript

Created on 2 Jun 2018  路  3Comments  路  Source: storybookjs/storybook

If you are reporting a bug or requesting support, start here:

Bug or support request summary

npm run story expect to work, but throws error instead

albert:ttt albertgao$ npm run storybook

> [email protected] storybook /Users/albertgao/codes/temp/ttt
> storybook start -p 7007 --metro-config $PWD/rn-cli.config.js


  error: unknown option `--metro-config'

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] storybook: `storybook start -p 7007 --metro-config $PWD/rn-cli.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] storybook script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/albertgao/.npm/_logs/2018-06-02T10_58_22_014Z-debug.log

Steps to reproduce

  1. Create a new react-native app: react-native init test --template typescript
  2. Setup typescript support : cd test && node setup.js
  3. getstorybook
  4. replace storybook command with storybook start -p 7007 --metro-config $PWD/rn-cli.config.js
  5. Run npm run storybook

Please specify which version of Storybook and optionally any affected addons that you're running

  • "react-native": "0.55.4"
  • "@ storybook/react-native": "^3.4.6",
  • "@ storybook/addon-actions": "^3.4.6",
  • "@ storybook/addon-links": "^3.4.6",-
  • "@ storybook/addons": "^3.4.6",

Found a PR https://github.com/storybooks/storybook/pull/3694, but seems the updated content not work at all.

Most helpful comment

Has this feature been removed? This fails for me using 4.0.0-alpha.16

All 3 comments

That is because you are using 3.4.6 but the option was added from 4.0.0-alpha.2 (#3209).

Thanks! It works now!

Has this feature been removed? This fails for me using 4.0.0-alpha.16

Was this page helpful?
0 / 5 - 0 ratings