SBT:错误:未找到:值npmDependencies npmDependencies in Compile ++ = Seq(...)

问题描述 投票:0回答:1

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

启动sbt时,我得到以下异常:

error: not found: value npmDependencies

编译++中的npmDependencies = 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")

和我的Build.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")
sbt scala.js scalably-typed
1个回答
1
投票

npmDependencies是由scalajs-bundler提供的密钥,因此您需要在project/plugins.sbt中使用以下行:

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

build.sbt

enablePlugins(ScalaJSBundlerPlugin)
© www.soinside.com 2019 - 2024. All rights reserved.