Skip to main content

Solution to Error downloading error when installing Scala in Coursier

According to Scala’s official current installation tutorial https://docs.scala-lang.org/getting-started/index.html, we download cs-x86_64-pc-win32.zip and extract it to cs-x86_64-pc-win32.exe . In PowerShell, java --versionconfirm whether the JVM is installed. If it is installed, switch to the directory where the file is located and run

.\cs-x86_64-pc-win32.exe

Show error

Error downloading https://github.com/VirtusLab/scala-cli/releases/download/v1.0.2/scala-cli-x86_64-pc-win32.zip

The following error may also be displayed: Running

in PowerShell

.\cs-x86_64-pc-win32.exe /?

Show help:

After checking, Coursier does not have a proxy setting during the installation phase , so we need to set up the proxy on the host, manually download the file to the local and let the installation program black box automatically recognize it. The specific steps are as follows: First, download the corresponding version of scala-cli (here is https://github.com/VirtusLab/scala-cli/releases/download/v1.0.2/scala-cli-x86_64-pc-win32.zip) Go to C:\Users<username>\AppData\Local\Coursier\cache\v1\https\github.com\VirtusLab\scala-cli\releases\download\v1.0.2, as shown in the figure:

Rerun .\cs-x86_64-pc-win32.exe:

the same will correspond Version of sbt (here is https://github.com/sbt/sbt/releases/download/v1.9.2/sbt-1.9.2.zip) downloaded to C:\Users<username>\AppData\Local\Coursier\ cache\v1\https\github.com\sbt\sbt\releases\download\v1.9.2. Rerun .\cs-x86_64-pc-win32.exe:

installation successful. Check version: