question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[command:version] Version number in related peerDependencies don't update

See original GitHub issue

When run lerna version also respect dependencies in peerDependencies.

Current Behavior

When execution lerna version the peerDependencies don’t update, but the devDependencies do. Here a result after the bumping version of packageA and packageB from 0.0.0 to 0.0.1

packageA

{
  "name": "packageA",
  "version": "0.0.1",
}

packageB

{
  "name": "packageB",
  "version": "0.0.1",
  "peerDependencies": {
    "@scope/packageA": "0.0.0"
  },
  "devDependencies": {
    "@scope/packageA": "0.0.1"
  }
}

Expected Behavior

packageA

{
  "name": "packageA",
  "version": "0.0.1",
}

packageB

{
  "name": "packageB",
  "version": "0.0.1",
  "peerDependencies": {
    "@scope/packageA": "0.0.1"
  },
  "devDependencies": {
    "@scope/packageA": "0.0.1"
  }
}

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:17
  • Comments:5

github_iconTop GitHub Comments

12reactions
arsnlcommented, Jan 13, 2021

@ValeryVS true. Peer dependencies don’t act the same as dev nor prod dependencies. However, in some case the peerDependencies should follow the current version. Maybe we should add a new option to the version command to cover this need? Something like --update-peer-dependencies.

0reactions
runspiredcommented, Nov 8, 2022

An OSS project I work on with many packages in a mono-repo with peer-deps on each other moved to strictly declaring peerDependencies recently now that most package managers properly support and respect them. Unfortunately, this results in peerDependencies being incorrect. We can manually fix the versions during our release process; however, it makes lerna’s version command not all that useful since the commit and tag would not include this change.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature: allow updating peerDependencies in version ...
Lerna should allow updating peerDependencies in the version/publish command, cf the behaviour in previous versions (we were using 2.6.0) ...
Read more >
How to fix npm dependency hell - Sylhare's blog
This way you'll be able to update the dependency to the latest version that is not a breaking change, run the tests, build...
Read more >
How do I override nested NPM dependency versions?
Adding phantomjs to my package's dependencies first has no effect; both versions are installed and grunt-contrib-jasmine still uses the older versions (see: ...
Read more >
npm Peer Dependencies - JavaScript inDepth
Peer Dependencies are used to specify that our package is compatible with a specific version of an npm package. Good examples are Angular...
Read more >
How to Fix NPM Package Does Not Satisfy Its Siblings ...
The solution is to either update or uninstall the modules. Afterwards, you can run the install command for the actual package again and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found