nrwl / nx

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

When genererating a react app it will not download other plugins that the generator depends on #14959

Closed JCombee closed 1 year ago

JCombee commented 1 year ago

Current Behavior

It throw's an error:

 >  NX   Cannot find module '@nrwl/cypress'

   Require stack:
   - /home/jerke/workspace/jerke/node_modules/@nrwl/react/src/generators/init/init.js
   - /home/jerke/workspace/jerke/node_modules/@nrwl/react/src/generators/application/application.js
   - /home/jerke/workspace/jerke/foo-bar/node_modules/nx/src/config/workspaces.js
   - /home/jerke/workspace/jerke/foo-bar/node_modules/nx/src/config/configuration.js
   - /home/jerke/workspace/jerke/foo-bar/node_modules/nx/src/command-line/generate.js
   - /home/jerke/workspace/jerke/foo-bar/node_modules/nx/src/command-line/nx-commands.js
   - /home/jerke/workspace/jerke/foo-bar/node_modules/nx/bin/init-local.js
   - /home/jerke/workspace/jerke/foo-bar/node_modules/nx/bin/nx.js
   Pass --verbose to see the stacktrace.

Expected Behavior

It will not throw the error but instead install the required module to continue.

GitHub Repo

No response

Steps to Reproduce

  1. npx create-nx-workspace@latest foo-bar --preset=ts
  2. cd foo-bar
  3. npx nx g @nrwl/react:app my-app --bundler=vite

Nx Report

>  NX   Report complete - copy this into the issue template

   Node : 18.12.1
   OS   : linux x64
   npm  : 8.19.2

   nx : 15.6.3
   @nrwl/angular : Not Found
   @nrwl/cypress : 15.6.3
   @nrwl/detox : Not Found
   @nrwl/devkit : 15.6.3
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : Not Found
   @nrwl/expo : Not Found
   @nrwl/express : Not Found
   @nrwl/jest : Not Found
   @nrwl/js : 15.6.3
   @nrwl/linter : 15.6.3
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : 15.0.3
   @nrwl/nx-plugin : Not Found
   @nrwl/react : 15.6.3
   @nrwl/react-native : Not Found
   @nrwl/rollup : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : Not Found
   @nrwl/web : Not Found
   @nrwl/webpack : Not Found
   @nrwl/workspace : 15.6.3
   @nrwl/vite : Not Found
   typescript : 4.8.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:

Failure Logs

➜  app npx create-nx-workspace@latest foo-bar --preset=ts

 >  NX   Let's create a new workspace [https://nx.dev/getting-started/intro]

✔ Enable distributed caching to make your CI faster · Yes

 >  NX   Nx is creating your v15.6.3 workspace.

   To make sure the command works reliably in all environments, and that the preset is applied correctly,
   Nx will run "npm install" several times. Please wait.

✔ Installing dependencies with npm
✔ Nx has successfully created the workspace: foo-bar.
✔ NxCloud has been set up successfully

 >  NX   Successfully initialized git.

 —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  NX   First time using Nx? Check out this interactive Nx tutorial.

   https://nx.dev/getting-started/nx-and-typescript

 >  NX   Distributed caching via Nx Cloud has been enabled

   In addition to the caching, Nx Cloud provides config-free distributed execution,
   UI for viewing complex runs and GitHub integration. Learn more at https://nx.app

   Your workspace is currently unclaimed. Run details from unclaimed workspaces can be viewed on cloud.nx.app by anyone
   with the link. Claim your workspace at the following link to restrict access.

   https://cloud.nx.app/orgs/workspace-setup?accessToken=MGFlM2JmMTUtYjg3ZC00MmY1LWFjMjUtOTBjNDQ3NmQ3MmI5fHJlYWQtd3JpdGU=

➜  app cd foo-bar                                        
➜  foo-bar git:(main) npx nx g @nrwl/react:app my-app --bundler=vite    

>  NX  Generating @nrwl/react:application

✔ Which stylesheet format would you like to use? · css
✔ Would you like to add React Router to this application? (y/N) · false

added 4 packages, and audited 353 packages in 3s

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

found 0 vulnerabilities

 >  NX   Cannot find module '@nrwl/cypress'

   Require stack:
   - /home/app/workspace/app/node_modules/@nrwl/react/src/generators/init/init.js
   - /home/app/workspace/app/node_modules/@nrwl/react/src/generators/application/application.js
   - /home/app/workspace/app/foo-bar/node_modules/nx/src/config/workspaces.js
   - /home/app/workspace/app/foo-bar/node_modules/nx/src/config/configuration.js
   - /home/app/workspace/app/foo-bar/node_modules/nx/src/command-line/generate.js
   - /home/app/workspace/app/foo-bar/node_modules/nx/src/command-line/nx-commands.js
   - /home/app/workspace/app/foo-bar/node_modules/nx/bin/init-local.js
   - /home/app/workspace/app/foo-bar/node_modules/nx/bin/nx.js
   Pass --verbose to see the stacktrace.

➜  foo-bar git:(main) ✗

Additional Information

No response

xiongemi commented 1 year ago

i could no longer produce this issue. i think is already fixed in this pr https://github.com/nrwl/nx/pull/15074/. close this issue.

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.