nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.29k stars 2.32k forks source link

Bug with the @nrwl/angular:storybook-configuration generator #15373

Closed eweap closed 1 year ago

eweap commented 1 year ago

Current Behavior

Generating a storybook configuration for an angular app fail with the error Cannot find module 'typescript' (see failure log)

Expected Behavior

The command

npx nx generate @nrwl/angular:storybook-configuration app --no-interactive

should not fail and generate the storybook configuration

GitHub Repo

No response

Steps to Reproduce

  1. Create a new monorepo with
    npx create-nx-workspace@latest foo --preset=angular-monorepo --appName=app --style=scss --nxCloud=0
  2. Generate a storybook configration with
    npx nx generate @nrwl/angular:storybook-configuration app --no-interactive

Nx Report

>  NX   Report complete - copy this into the issue template

   Node : 18.12.0
   OS   : linux x64
   npm  : 8.19.2

   nx                      : 15.8.1
   @nrwl/js                : 15.8.1
   @nrwl/jest              : 15.8.1
   @nrwl/linter            : 15.8.1
   @nrwl/workspace         : 15.8.1
   @nrwl/angular           : 15.8.1
   @nrwl/cli               : 15.8.1
   @nrwl/cypress           : 15.8.1
   @nrwl/devkit            : 15.8.1
   @nrwl/eslint-plugin-nx  : 15.8.1
   @nrwl/tao               : 15.8.1
   @nrwl/webpack           : 15.8.1
   typescript              : 4.9.5

Failure Logs

*  Executing task: npx nx generate @nrwl/angular:storybook-configuration app --no-interactive 

>  NX  Generating @nrwl/angular:storybook-configuration

added 334 packages, and audited 335 packages in 17s

30 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

 >  NX   Cannot find module 'typescript'

   Require stack:
   - /tmp/tmp-67062-2WEKhM0cdXmq/node_modules/@nrwl/storybook/src/utils/utilities.js
   - /tmp/tmp-67062-2WEKhM0cdXmq/node_modules/@nrwl/storybook/src/generators/cypress-project/cypress-project.js
   - /tmp/tmp-67062-2WEKhM0cdXmq/node_modules/@nrwl/storybook/src/generators/configuration/configuration.js
   - /tmp/tmp-67062-2WEKhM0cdXmq/node_modules/@nrwl/storybook/index.js
   - /home/user/projects/foo/node_modules/@nrwl/devkit/src/utils/package-json.js
   - /home/user/projects/foo/node_modules/@nrwl/devkit/src/generators/to-js.js
   - /home/user/projects/foo/node_modules/@nrwl/devkit/public-api.js
   - /home/user/projects/foo/node_modules/@nrwl/devkit/index.js
   - /home/user/projects/foo/node_modules/@nrwl/angular/src/generators/storybook-configuration/storybook-configuration.js
   - /home/user/projects/foo/node_modules/nx/src/config/workspaces.js
   - /home/user/projects/foo/node_modules/nx/src/config/configuration.js
   - /home/user/projects/foo/node_modules/nx/src/command-line/generate.js
   - /home/user/projects/foo/node_modules/nx/src/command-line/nx-commands.js
   - /home/user/projects/foo/node_modules/nx/bin/init-local.js
   - /home/user/projects/foo/node_modules/nx/bin/nx.js
   Pass --verbose to see the stacktrace.

 *  The terminal process "/usr/bin/zsh '-c', 'npx nx generate @nrwl/angular:storybook-configuration app --no-interactive'" terminated with exit code: 1.

Additional Information

No response

mandarini commented 1 year ago

Ohh I think you should first install the @nrwl/storybook package!

yarn add -D @nrwl/storybook@latest
mandarini commented 1 year ago

Fixed here: https://github.com/nrwl/nx/pull/15386

eweap commented 1 year ago

@mandarini Thank you for your quick support !

github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.