Nx: storybook nx run problem

Created on 15 Mar 2020  路  4Comments  路  Source: nrwl/nx

storybook problem after install on new workspace

PS C:\Users\conio\Downloads\conio-test> nx run conio:storybook
> nx run octo-clicks-ui:storybook
Cannot find module '@storybook/core/dist/server/build-dev'
Require stack:
- C:\Users\conio\Downloads\conio-test\node_modules\@nrwl\storybook\src\builders\storybook\storybook.impl.js
- C:\Users\conio\Downloads\conio-test\node_modules\@angular-devkit\architect\node\node-modules-architect-host.js
- C:\Users\conio\Downloads\conio-test\node_modules\@angular-devkit\conio\node\index.js
- C:\Users\conio\Downloads\conio-test\node_modules\@nrwl\tao\src\commands\run.js
- C:\Users\conio\Downloads\conio-test\node_modules\@nrwl\tao\index.js
- C:\Users\conio\Downloads\conio-test\node_modules\@nrwl\cli\lib\run-cli.js

storybook install inside react libs, any suggestion?

storybook bug

Most helpful comment

I just ran into the same issue!

In my case it turned out that Nx added a devDependency for @babel/core targetting version 8.0.6, which doesn't exist (latest version is 7.8.7).
This makes the npm install fail silently and thus the storybook files aren't being installed inside node_modules.

The workaround:

  1. Remove the invalid @babel/core target from the devDependencies and manually install it using npm install --save-dev @babel/core@latest.
  2. Re-run npm install, which will correctly install everything related to storybook now.
  3. Now you can start your storybook as expected, in your case nx run octo-clicks-ui:storybook

Hope this solved your problem!

Please don't close this issue as this is a real issue.
Nx should target the correct babel/core version.

All 4 comments

I just ran into the same issue!

In my case it turned out that Nx added a devDependency for @babel/core targetting version 8.0.6, which doesn't exist (latest version is 7.8.7).
This makes the npm install fail silently and thus the storybook files aren't being installed inside node_modules.

The workaround:

  1. Remove the invalid @babel/core target from the devDependencies and manually install it using npm install --save-dev @babel/core@latest.
  2. Re-run npm install, which will correctly install everything related to storybook now.
  3. Now you can start your storybook as expected, in your case nx run octo-clicks-ui:storybook

Hope this solved your problem!

Please don't close this issue as this is a real issue.
Nx should target the correct babel/core version.

The above PR should fix this for everyone.

thank you @samcoenen :)

Just wanted to add that this affects angular libs as well.

Was this page helpful?
0 / 5 - 0 ratings