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

npmResolutions doesn’t work well with npmDevDependencies #186

julienrf opened this issue Nov 3, 2017 · 3 comments


Copy link

commented Nov 3, 2017

You might get incompatible resolutions between dev dependencies and dependencies.


npmResolutions in Compile := {
  (npmDependencies in Compile).value.toMap ++ (npmDevDependencies in Compile).value.toMap

@julienrf julienrf added the bug label Nov 3, 2017

@julienrf julienrf added this to the 1.0 milestone Jan 15, 2018


This comment has been minimized.

Copy link

commented May 29, 2019

I'm unsure what the exact problem is here. Is the problem that if I have:

npmDependencies ++= Seq("foo" -> "1.0", "foo" -> "1.1")
npmDevDependencies ++= Seq("foo" -> "2.0", "foo" -> "2.1")

that I cannot resolve "foo" to different versions for dependencies and devDependencies?

So would that be solved by adding a npmDevResolutions key? (and some backwards compatibility magic)?


This comment has been minimized.

Copy link

commented May 29, 2019

To summarize the discussion we had at Scala spree: The core of the issue here seems to be that npmResolutions only resolves resolution problems that happen due to npm dependencies of the Scala.js dependencies of the project. These npm dependencies in turn will have transitive dependencies that can cause more conflicts.

The solution here seems to be either of the following:

  • Push all dependency resolution to npm (or yarn).
  • Do all dependency resolution internally.

The first option is clearly preferred, but it is unclear how we can feed the Scala.js dependency tree to npm.


This comment has been minimized.

Copy link
Member Author

commented Jun 3, 2019

I’m also in favor of forwarding dependency resolutions to the underlying dependencies management tool (ie, yarn, because npm does not have support for that). This means that instead of having our own (broken) resolutions algorithm, we should just emit a resolutions field to our package.json file, as explained in yarn’s documentation. Additionally, we could emit a warning if npmResolutions is defined but useYarn is false because npm does not support this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.