nrwl / nx

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

Cannot find module '@nrwl/cypress/package.json' #28583

Closed henrikvolmer closed 2 hours ago

henrikvolmer commented 3 hours ago

Current Behavior

After updating to NX Version 20.0.3 (using nx migrate latest) e2e tests with cypress are not working anymore using nx run-many -t e2e command.

Following error appears:

 NX   Unable to resolve @nrwl/cypress:cypress.

Cannot find module '@nrwl/cypress/package.json'
Require stack:
- {repository}/node_modules/nx/src/utils/package-json.js
- {repository}/node_modules/nx/src/project-graph/plugins/loader.js
- {repository}/node_modules/nx/src/project-graph/plugins/index.js
- {repository}/node_modules/nx/src/command-line/run/executor-utils.js
- {repository}/node_modules/nx/src/devkit-internals.js
- {repository}/node_modules/nx/src/utils/assert-workspace-validity.js
- {repository}/node_modules/nx/src/project-graph/build-project-graph.js
- {repository}/node_modules/nx/src/project-graph/project-graph.js
- {repository}/node_modules/nx/src/project-graph/file-utils.js
- {repository}/node_modules/nx/src/utils/package-manager.js
- {repository}/node_modules/nx/src/utils/child-process.js
- {repository}/node_modules/nx/src/command-line/migrate/command-object.js
-{repository}/node_modules/nx/src/command-line/nx-commands.js
- {repository}/node_modules/nx/bin/init-local.js
- {repository}/node_modules/nx/bin/nx.js

Note: {repository}/ is the path to my repository on my local device.

Expected Behavior

Cypress commands are working again.

GitHub Repo

No response

Steps to Reproduce

1.

Nx Report

NX Report complete - copy this into the issue template

Node : 20.17.0 OS : darwin-arm64 Native Target : aarch64-macos npm : 10.8.2

nx : 20.0.3 @nx/js : 20.0.3 @nx/jest : 20.0.3 @nx/eslint : 20.0.3 @nx/workspace : 20.0.3 @nx/cypress : 20.0.3 @nx/devkit : 20.0.3 @nx/eslint-plugin : 20.0.3 @nx/next : 20.0.3 @nx/plugin : 20.0.3 @nx/react : 20.0.3 @nx/storybook : 20.0.3 @nx/vite : 20.0.3 @nx/web : 20.0.3 @nx/webpack : 20.0.3 typescript : 5.6.3

Local workspace plugins: @dgg-frontend/generators @dgg-frontend/executors

Failure Logs

No response

Package Manager Version

npm@10.8.2

Operating System

Additional Information

No response

henrikvolmer commented 2 hours ago

I found the issue in my code. Because of using generators in the past, some of my e2e projects had the old @nrwl/cypress executor instead of the new @nx/cypress executors.