Intellij Idea: sbt refresh FetchError$DownloadingArtifacts npm-4.2.0-sources.jar: not found

Ari*_*rie 2 java intellij-idea sbt

将 Intellij idea 与 sbt 一起使用时,出现错误:

[error] (updateSbtClassifiers) lmcoursier.internal.shaded.coursier.error.FetchError$DownloadingArtifacts: Error fetching artifacts:
[error] https://repo1.maven.org/maven2/org/webjars/npm/4.2.0/npm-4.2.0-sources.jar: not found: https://repo1.maven.org/maven2/org/webjars/npm/4.2.0/npm-4.2.0-sources.jar
Run Code Online (Sandbox Code Playgroud)

Intellij Idea 版本:2018.1(是的,我知道它很旧,但也可能发生在较新的版本上)

如何解决这个问题?

Ari*_*rie 7

有一个(当前)未解决的问题

我不太确定为什么会发生这种情况,可能这个 stackoverflow 答案可以解释为什么会发生这种情况。

但总而言之,在该线程上有一个对我有用的答案。

...
I think I solved the issue. In IntelliJ IDEA, go to 
Preferences => Build, Execution, Deployment => 
Build Tools => sbt => sbt projects. 

Untick "Library sources" & "sbt sources".

I tested it on 2019.3.4 & 2020.1. Both versions work correctly.
...
Run Code Online (Sandbox Code Playgroud)

希望这对其他人有帮助:)