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

Keep package versions synced? #3757

Closed
1 task done
mokone91 opened this issue Sep 15, 2021 · 2 comments
Closed
1 task done

Keep package versions synced? #3757

mokone91 opened this issue Sep 15, 2021 · 2 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release

Comments

@mokone91
Copy link

mokone91 commented Sep 15, 2021

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Hi there!
I going to migrate my monorepo from lerna to npm 7 and faced with the next issue:
when I doing npm --workspaces version pach - my packages updated as expected, but dependency in "package-a" still have old dependency version of "package-b"

how can i solve this issue?

@mokone91 mokone91 added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Sep 15, 2021
@jharvey10
Copy link

I'm not an npm maintainer or anything, but I hit the same thing moving off of Lerna. I think what you describe is the "value add" that Lerna offers.

npm update on its own won't pick up the new local version either. It'll instead resolve your dep against the latest version from the remote registry. It also appears that once a package has been resolved against a remote registry, it is not possible to "switch back" to a locally managed version by using another npm update command. You could instead run another npm install of the package and that will try the local version first if the version matches, but it's not ideal.

The way I'm going to approach this is to do something like:

npm --workspace <my_pkg> version patch
npm --workspace <some_workspace_that_uses_my_pkg> pkg set "dependencies.<my_pkg>=^x.y.z"
npm install

Where x.y.z is the new package version created by the version command.

I really wish that npm update would resolve against the new local dep first though. That would make this whole thing super simple. This looks to have a similar open issue over at #3940

@wraithgar
Copy link
Member

Closing as a duplicate of #3403

ruyadorno added a commit to ruyadorno/cli that referenced this issue Mar 17, 2022
Adds a minimalistic reify step that updates the installed tree after a
version change within one of the configured workspaces when using any
of the workspaces config options.

It's also possible to use the `--save` config option in order to
auto update semver ranges of dependencies declarations accross dependent
`package.json` files.

Fixes: npm#3403
Relates to: npm/rfcs#556
Relates to: npm#3757
Relates to: npm#4193
ruyadorno added a commit to ruyadorno/cli that referenced this issue Mar 17, 2022
Adds a minimalistic reify step that updates the installed tree after a
version change within one of the configured workspaces when using any
of the workspaces config options.

It's also possible to use the `--save` config option in order to
auto update semver ranges of dependencies declarations accross dependent
`package.json` files.

Fixes: npm#3403
Relates to: npm/rfcs#556
Relates to: npm#3757
Relates to: npm#4193
ruyadorno added a commit to ruyadorno/cli that referenced this issue Mar 21, 2022
Adds a minimalistic reify step that updates the installed tree after a
version change within one of the configured workspaces when using any
of the workspaces config options.

It's also possible to use the `--save` config option in order to
auto update semver ranges of dependencies declarations accross dependent
`package.json` files.

Fixes: npm#3403
Relates to: npm/rfcs#556
Relates to: npm#3757
Relates to: npm#4193
fritzy pushed a commit that referenced this issue Mar 24, 2022
Adds a minimalistic reify step that updates the installed tree after a
version change within one of the configured workspaces when using any
of the workspaces config options.

It's also possible to use the `--save` config option in order to
auto update semver ranges of dependencies declarations accross dependent
`package.json` files.

Fixes: #3403
Relates to: npm/rfcs#556
Relates to: #3757
Relates to: #4193
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

3 participants