Search code examples
scalaplayframeworksbtwebjarsesprima

sbt.ResolveException: unresolved dependency: org.webjars.npm#esprima;3.1.0


I'm trying to build the project play-angular2-typescript but it fails to build with the error:

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.webjars.npm#esprima;[3.1.0,3.2): not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn]  Note: Unresolved dependencies path:
[warn]      org.webjars.npm:esprima:[3.1.0,3.2)
[warn]        +- org.webjars.npm:recast:[0.11.4,0.12)
[warn]        +- org.webjars.npm:unreachable-branch-transform:[0.5.0,0.6)
[warn]        +- org.webjars.npm:readable-stream:[2.0.5,3)
[warn]        +- org.webjars.npm:got:[5.0.0,6)
[warn]        +- org.webjars.npm:package-json:[2.0.0,3)
[warn]        +- org.webjars.npm:latest-version:[2.0.0,3)
[warn]        +- org.webjars.npm:update-notifier:[1.0.2,2)
[warn]        +- org.webjars.npm:tslint:4.4.2
[warn]        +- name.de-vries:sbt-tslint:4.4.2 (scalaVersion=2.10, sbtVersion=0.13) (/home/bravegag/code/play-angular2-typescript/project/plugins.sbt#L9-10)
[warn]        +- default:play-angular2-typescript-build:0.1-SNAPSHOT (scalaVersion=2.10, sbtVersion=0.13)
sbt.ResolveException: unresolved dependency: org.webjars.npm#esprima;[3.1.0,3.2): not found

I searched everywhere and could not find these esprima versions in any repo online. I was able to find up to version 2.7.2 only. Therefore, I added the following line to the build.sbt file:

dependencyOverrides += "org.webjars.npm" % "esprima" % "2.7.2"

but the sbt built still fails with the same error. Is there a way to fix this?

UPDATE the answer leads to:

[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] downloading https://repo1.maven.org/maven2/org/webjars/npm/esprima/3.1.3/esprima-3.1.3.jar ...
[info]  [SUCCESSFUL ] org.webjars.npm#esprima;3.1.3!esprima.jar (214ms)
[info] Done updating.

Solution

  • Transitive dependencies for NPM and Bower WebJars are not automatically deployed so this one was missing. I went to add it but there was a bug with license detection. I've fixed it: https://github.com/webjars/webjars/issues/1569#issuecomment-285048591

    Once that change is deployed I will deploy esprima 3.1.3.

    In the future you can deploy your own NPM WebJars at: http://www.webjars.org/npm