nrwl / nx

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

@nrwl/cypress not installing cypress #12546

Closed gioragutt closed 2 years ago

gioragutt commented 2 years ago

Current Behavior

When adding @nrwl/cypress and generating a new e2e project, it does not add cypress itself to the dependencies.

Expected Behavior

When using @nrwl/cypress, running e2e should work OOTB without installing cypress manually, at least without concrete warnings in the CLI that it's supposed to be a manual step.

Steps to Reproduce

npx create-nx-workspace@14.8.4 test-repo # version is 14.8.4
cd test-repo
npm add -D @nrwl/cypress
npx nx generate @nrwl/cypress:cypress-project test-1 --baseUrl=localhost:3000

Failure Logs

> nx run test-1:e2e

 >  NX   Cannot find module 'cypress'
   Require stack:
   - /Users/gioraguttsait/Git/POCs/shopify-cypress-poc/node_modules/@nrwl/cypress/src/executors/cypress/cypress.impl.js
   - /Users/gioraguttsait/Git/POCs/shopify-cypress-poc/node_modules/nx/src/config/workspaces.js
   - /Users/gioraguttsait/Git/POCs/shopify-cypress-poc/node_modules/nx/src/command-line/run.js
   - /Users/gioraguttsait/Git/POCs/shopify-cypress-poc/node_modules/nx/bin/run-executor.js
   Pass --verbose to see the stacktrace.

 >  NX   Running target "test-1:e2e" failed

   Failed tasks:

   - test-1:e2e

   Hint: run the command with --verbose for more details.

Environment

 >  NX   Report complete - copy this into the issue template

   Node : 14.19.3
   OS   : darwin x64
   npm  : 6.14.17

   nx : 14.8.4
   @nrwl/angular : Not Found
   @nrwl/cypress : 14.8.4
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.8.4
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : 14.8.4
   @nrwl/expo : Not Found
   @nrwl/express : Not Found
   @nrwl/jest : 14.8.4
   @nrwl/js : Not Found
   @nrwl/linter : 14.8.4
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : Not Found
   @nrwl/nx-plugin : Not Found
   @nrwl/react : Not Found
   @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 : 14.8.4
   typescript : 4.8.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:
barbados-clemens commented 2 years ago

I'm able to reproduce this, unsure what happened recently but it seems like the postinstall script isn't running anymore for cypress.

To get around it today you can run npx cypress install to force the install but going to look more into this. Thank you for the bug report.

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.