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

No Version Modifiers for Dependencies after Fresh Workspace Migration #29778

Open
1 of 4 tasks
joh-klein opened this issue Jan 28, 2025 · 0 comments
Open
1 of 4 tasks
Assignees
Labels
scope: core core nx functionality type: bug

Comments

@joh-klein
Copy link

Current Behavior

When creating a new Nx workspace from scratch, the package.json dependencies use version modifiers (e.g., ~ or ^). However, when migrating an older Nx workspace to a newer version, the package.json dependencies are pinned to specific versions (without version modifiers), which creates inconsistencies.

For example:

  1. New workspace (created from scratch, nx 20.4.0):
   "dependencies": {
     "@angular/animations": "~19.1.0",
     "@angular/common": "~19.1.0",
     "@angular/compiler": "~19.1.0",
     "@angular/core": "~19.1.0",
     "@angular/forms": "~19.1.0",
     "@angular/platform-browser": "~19.1.0",
     "@angular/platform-browser-dynamic": "~19.1.0",
     "@angular/router": "~19.1.0",
     "rxjs": "~7.8.0",
     "zone.js": "~0.15.0"
   }
  1. Migrated workspace (from nx 20.3.2 to 20.4.0):
   "dependencies": {
     "@angular/animations": "19.1.3",
     "@angular/common": "19.1.3",
     "@angular/compiler": "19.1.3",
     "@angular/core": "19.1.3",
     "@angular/forms": "19.1.3",
     "@angular/platform-browser": "19.1.3",
     "@angular/platform-browser-dynamic": "19.1.3",
     "@angular/router": "19.1.3",
     "rxjs": "~7.8.0",
     "zone.js": "~0.15.0"
   }

Expected Behavior

Using version modifiers aligns more with the expected behavior of dependency management in modern JavaScript ecosystems.

GitHub Repo

No response

Steps to Reproduce

  1. npx [email protected] --preset=angular-monorepo
  2. Note the use of version modifiers (e.g., ~19.1.0) in the package.json
  3. nx migrate latest
  4. Version modifiers are gone from all affected packages :(

Nx Report

NX   Report complete - copy this into the issue template

Node           : 22.13.1
OS             : darwin-arm64
Native Target  : aarch64-macos
npm            : 10.9.2

nx                     : 20.4.0
@nx/js                 : 20.4.0
@nx/jest               : 20.4.0
@nx/eslint             : 20.4.0
@nx/workspace          : 20.4.0
@nx/angular            : 20.4.0
@nx/devkit             : 20.4.0
@nx/eslint-plugin      : 20.4.0
@nx/module-federation  : 20.4.0
@nx/web                : 20.4.0
@nx/webpack            : 20.4.0
typescript             : 5.7.3
---------------------------------------
Community plugins:
angular-eslint : 19.0.2

Failure Logs

Package Manager Version

No response

Operating System

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

Additional Information

No response

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

No branches or pull requests

3 participants