Skip to content

[BUG] npm --workspaces version doesn't update dependencies #3403

Closed
@niemyjski

Description

@niemyjski

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The npm --no-git-tag-version --workspaces version <version> command doesn't update package devDependencies or dependencies with the new version. I'd expect that workspace dependencies would be updated to match the new versions that were set.

Expected Behavior

npm --no-git-tag-version --workspaces version "2.0.0-alpha1" should update all workspace package versions (currently does) and also update the package dependency versions

Steps To Reproduce

  1. Setup a new npm workspace
  2. Create /packages/packagea :
{
  "name": "packagea",
  "version": "2.0.0-dev"
}
  1. Create ``/packages/packageb`:
{
  "name": "packageb",
  "version": "2.0.0-dev",
  "dependencies": {
      "packagea": "2.0.0-dev"
    }
}
  1. Run npm --no-git-tag-version --workspaces version "2.0.0-alpha1"
  2. notice the package versions are updated but the dependencies are not.

I have an existing setup located here: https://github.com/exceptionless/Exceptionless.JavaScript/tree/feature/workspaces that reproduces it (but package names are changed...)

I noticed this after getting the following error:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for @exceptionless/core@2.0.0-dev.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

Environment

  • OS: Windows 10 latest
  • Node: v16.1.0
  • npm: 7.17.0

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingPriority 1high priority issueRelease 7.xwork is associated with a specific npm 7 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions