Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to run 'npm install' following migration from 20.4.0 to 20.4.1 #29921

Closed
1 of 4 tasks
n-mcnally opened this issue Feb 6, 2025 · 2 comments · Fixed by #29931
Closed
1 of 4 tasks

Failed to run 'npm install' following migration from 20.4.0 to 20.4.1 #29921

n-mcnally opened this issue Feb 6, 2025 · 2 comments · Fixed by #29931
Assignees
Labels
scope: core core nx functionality type: bug

Comments

@n-mcnally
Copy link

n-mcnally commented Feb 6, 2025

Current Behavior

After running npx nx migrate latest to update to 20.4.1 (from 20.4.0) running npm install failed with a resolution error.

Expected Behavior

Should successfully install following migration.

GitHub Repo

No response

Steps to Reproduce

  1. Run npx nx migrate latest and then try to install following migration.

Nx Report

Unable to run

Failure Logs

# npm resolution error report

While resolving: @nx/playwright@20.4.1
Found: @nx/vite@20.4.1
node_modules/@nx/vite
  dev @nx/vite@"20.4.1" from the root project

Could not resolve dependency:
peerOptional @nx/vite@"file:../vite" from @nx/playwright@20.4.1
node_modules/@nx/playwright
  dev @nx/playwright@"20.4.1" from the root project

Conflicting peer dependency: @nx/vite@undefined
node_modules/@nx/vite
  peerOptional @nx/vite@"file:../vite" from @nx/playwright@20.4.1
  node_modules/@nx/playwright
    dev @nx/playwright@"20.4.1" from the root project

Fix the upstream dependency conflict, or retry
this command with --force or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

Any the related nx devDependencies are:

{
    "@nx/eslint": "20.4.1",
    "@nx/eslint-plugin": "20.4.1",
    "@nx/js": "20.4.1",
    "@nx/playwright": "20.4.1",
    "@nx/react": "20.4.1",
    "@nx/vite": "20.4.1",
    "@nx/web": "20.4.1",
    "@nx/workspace": "20.4.1",
    "vite": "^5.0.0",
    "vitest": "^2.1.8",
    // ...
}

Package Manager Version

npm 11.0.0

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@n-mcnally n-mcnally changed the title Failed to run 'npm install' following migrate from 20.4.0 to 20.4.1 Failed to run 'npm install' following migration from 20.4.0 to 20.4.1 Feb 6, 2025
@masonmark
Copy link

masonmark commented Feb 7, 2025

I got the same thing updating to 20.4.1. If using npm one fairly targeted way to work around this is to add this to your package.json file:

  "overrides": {
    "@nx/playwright@20.4.1": {
      "@nx/vite": "20.4.1"
    }
  },

(If using pnpm or yarn IIRC the equivalent feature is called resolutions.)

That forces the @nx/vite package to version "20.4.1" but only for the @nx/playwright@20.4.1" package, so it shouldn't affect the rest of your dependency graph. I expect this is a packaging error that will be fixed in 20.4.2...

Update

In our case, I had to also add the same workaround for @nx/webpack:

  "overrides": {
    "@nx/playwright@20.4.1": {
      "@nx/vite": "20.4.1",
      "@nx/webpack": "20.4.1"
    }
  },

@FrozenPandaz
Copy link
Collaborator

That's not right. @AgentEnder can you take a look into this please?

@FrozenPandaz FrozenPandaz added the scope: core core nx functionality label Feb 7, 2025
FrozenPandaz added a commit that referenced this issue Feb 8, 2025
#29931)

…800)"

This reverts commit a5f13a2.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

`@nx/playwright` is published with improper peer dependencies because
`nx release` does not support this apparently.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

`@nx/playwright` is published with `dependencies` again for now.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #29921

(cherry picked from commit 4c66403)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: core core nx functionality type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants