Warm tip: This article is reproduced from serverfault.com, please click

sbt 1.4.4 with IntelliJ: Extracting structure failed

发布于 2020-12-01 14:37:59

I am getting a rather strange error when trying to use the IntelliJ built-in sbt-compiler to open projects with sbt 1.4.0 or higher:

Extracting structure failed

Everything works fine for projects configured to use sbt 1.3.x or lower. In this example, I was trying to open the ScalablyTyped Demo project. The same keeps happening with other projects as well. I upgraded my IntelliJ to the Community 2020.2 version and the Scala plugin to version 2020.2.49, but to no avail.

Compiling the projects with the built-in sbt shell works, so it seems to be a problem of IntelliJ itself. Any hint would be greatly appreciated.

Edit 2:

This seems to be causing the error, but I have yarn installed and can use it in a cli, so that is rather surprising:

* Welcome to ScalablyTyped demos!
*
* For documentation see https://scalablytyped.org .
*
* Note that the first time you import/compile the projects it'll take a while for the dependencies to build
*
[info] set current project to demos-master (in build file:/C:/Users/baierlf/Downloads/Demos-master/Demos-master/)
[error] stack trace is suppressed; run 'last electron / externalNpm' for the full output
[error] stack trace is suppressed; run 'last electron / ssExtractDependencies' for the full output
[error] (electron / externalNpm) java.io.IOException: Cannot run program "yarn" (in directory "C:\Users\baierlf\Downloads\Demos-master\Demos-master\electron"): CreateProcess error=2, Das System kann     die angegebene Datei nicht finden
[error] (electron / ssExtractDependencies) java.io.IOException: Cannot run program "yarn" (in directory "C:\Users\baierlf\Downloads\Demos-master\Demos-master\electron"): CreateProcess error=2, Das     System kann die angegebene Datei nicht finden
[error] Total time: 3 s, completed 01.12.2020 15:42:43
[info] shutting down sbt server

Translation:

German: Das System kann die angegebene Datei nicht finden

English: The system is unable to locate the file

Edit 3:

I can run the yarn command, when doing it manually:

yarn

Questioner
Florian Baierl
Viewed
0
Tomer Shetah 2020-12-01 23:04:42

There is an issue about that in github: java.io.IOException: Cannot run program "yarn".

The suggestion there is to add yarn to the path in the environment variables.

If that doesn't help, you can try, as a workaround, to set the path to yarn here manually. In case someone will read this in the future, and the code will change, you should change the line with the content:

Process("yarn", baseDirectory.value).!