如何修复 org.scala-js#sbt-scalajs;0.6.2:未找到

how to fix org.scala-js#sbt-scalajs;0.6.2: not found

我是第一次尝试教程。

我好像漏掉了一些仓库。

错误是:

[warn]  module not found: org.scala-js#sbt-scalajs;0.6.2
[warn] ==== typesafe-ivy-releases: tried
[warn]   https://repo.typesafe.com/typesafe/ivy-releases/org.scala-js/sbt-scalajs/scala_2.11/sbt_0.13/0.6.2/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn]   https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-js/sbt-scalajs/scala_2.11/sbt_0.13/0.6.2/ivys/ivy.xml
[warn] ==== local: tried
[warn]   C:\Users\fairj_000\.ivy2\local\org.scala-js\sbt-scalajs\scala_2.11\sbt_0.13[=11=].6.2\ivys\ivy.xml
[warn] ==== Local Maven Repository: tried
[warn]   C:\Users\fairj_000\.ivy2\org.scala-js\sbt-scalajs[=11=].6.2\ivys\ivy.xml
[warn] ==== oschina nexus: tried
[warn]   http://maven.oschina.net/content/groups/public/org/scala-js/sbt-scalajs_2.11_0.13/0.6.2/sbt-scalajs-0.6.2.pom
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/scala-js/sbt-scalajs_2.11_0.13/0.6.2/sbt-scalajs-0.6.2.pom
[warn] ==== Typesafe repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/org/scala-js/sbt-scalajs_2.11_0.13/0.6.2/sbt-scalajs-0.6.2.pom
[warn] ==== Typesafe Snapshots: tried
[warn]   https://repo.typesafe.com/typesafe/snapshots/org/scala-js/sbt-scalajs_2.11_0.13/0.6.2/sbt-scalajs-0.6.2.pom
[warn] ==== sonatype-snapshots: tried
[warn]   https://oss.sonatype.org/content/repositories/snapshots/org/scala-js/sbt-scalajs_2.11_0.13/0.6.2/sbt-scalajs-0.6.2.pom
[warn] ==== sonatype-public: tried
[warn]   https://oss.sonatype.org/content/repositories/public/org/scala-js/sbt-scalajs_2.11_0.13/0.6.2/sbt-scalajs-0.6.2.pom
[warn] ==== Sonatype snapshots: tried
[warn]   https://oss.sonatype.org/content/repositories/snapshots/org/scala-js/sbt-scalajs_2.11_0.13/0.6.2/sbt-scalajs-0.6.2.pom
[warn] ==== Sonatype release: tried
[warn]   https://oss.sonatype.org/content/repositories/releases/org/scala-js/sbt-scalajs_2.11_0.13/0.6.2/sbt-scalajs-0.6.2.pom

这是我的 project/plugin.sbt

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.2")  

build.sbt:

name := """scalajstest"""

version := "1.0"

scalaVersion := "2.11.6"

enablePlugins(ScalaJSPlugin)  

build.properties:

#Activator-generated Properties
#Mon Apr 13 01:08:48 CST 2015
template.uuid=d9b4f0bf-a417-4065-80af-1184e996ed95
sbt.version=0.13.7

我应该添加额外的存储库吗?它是什么?

要在评论中恢复讨论:

TL;DR: 从全局 sbt 配置中删除 scalaVersion := "2.11.x"

OP 在他的全局 sbt 配置中有一个 scalaVersion := "2.11.6"。这导致构建本身使用 Scala 2.11 进行编译。

但是,sbt 当前使用 Scala 2.10 进行编译,并且相关工件仅针对 Scala 2.10 发布。因此,查找为 Scala 2.11 编译的 Scala.js sbt-plugin 失败。