SBT:错误:找不到:值npmDependencies在编译++ = Seq(...)中的npmDependencies

时间:2019-04-17 10:33:19

标签: sbt scala.js scalably-typed

我尝试使用[ScalablyTyped] [1]开始一个项目。

启动sbt时出现以下异常:

error: not found: value npmDependencies

npmDependency在编译++ = Seq(“ d3”->“ 5.5.0”)

这是我的plugin.sbt

resolvers += Resolver.bintrayRepo("oyvindberg", "ScalablyTyped")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.26")
addSbtPlugin("org.scalablytyped" % "sbt-scalablytyped" % "201904160530")

和我的Builod.sbt:

enablePlugins(ScalaJSPlugin)

name := "Scala.js Tutorial"
scalaVersion := "2.12.6" 
resolvers += Resolver.bintrayRepo("oyvindberg", "ScalablyTyped")
libraryDependencies ++= Seq(ScalablyTyped.D.d3)
npmDependencies in Compile ++= Seq("d3" -> "5.5.0")

1 个答案:

答案 0 :(得分:1)

npmDependenciesscalajs-bundler提供的密钥,因此在project/plugins.sbt中需要以下行:

addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.14.0")

build.sbt

enablePlugins(ScalaJSBundlerPlugin)