ScalablyTyped / SlinkyDemos

MIT License
29 stars 8 forks source link

java.io.IOException: Cannot run program "yarn" #12

Closed mvillafuertem closed 4 years ago

mvillafuertem commented 4 years ago

I get this error, when I try to open the project with IntelliJ IDEA. Any suggestion is welcome. Thanks

[info] Set current project to slinkydemos (in build file:/tmp/SlinkyDemos/)
[error] stack trace is suppressed; run 'last react-native / externalNpm' for the full output
[error] stack trace is suppressed; run 'last storybook-react / externalNpm' for the full output
[error] stack trace is suppressed; run 'last react-native / ssExtractDependencies' for the full output
[error] stack trace is suppressed; run 'last storybook-react / ssExtractDependencies' for the full output
[error] (react-native / externalNpm) java.io.IOException: Cannot run program "yarn" (in directory "/tmp/SlinkyDemos/react-native"): error=2, No such file or directory
[error] (storybook-react / externalNpm) java.io.IOException: Cannot run program "yarn" (in directory "/tmp/SlinkyDemos/storybook-react"): error=2, No such file or directory
[error] (react-native / ssExtractDependencies) java.io.IOException: Cannot run program "yarn" (in directory "/tmp/SlinkyDemos/react-native"): error=2, No such file or directory
[error] (storybook-react / ssExtractDependencies) java.io.IOException: Cannot run program "yarn" (in directory "/tmp/SlinkyDemos/storybook-react"): error=2, No such file or directory
[error] Total time: 3 s, completed 31 Mar 2020, 11:46:35
[info] shutting down sbt server)
$ sw_vers

ProductName:    Mac OS X
ProductVersion: 10.15.3
BuildVersion:   19D76

$ which yarn

/usr/local/bin/yarn

$ yarn --version

1.22.4
oyvindberg commented 4 years ago

hmm, yarn will need to be on the path as intellij sees it perhaps? To unblock yourself you can add the absolute path here https://github.com/ScalablyTyped/SlinkyDemos/blob/master/build.sbt#L131 and for the other failing module. If you come up with a better way of running yarn from sbt I'd be happy to accept a PR for that :)

mvillafuertem commented 4 years ago

I have checked that sbt shell can't see /usr/local and I don't know how add my env PATH

    val value = Process(Seq("bash", "-c", "echo $PATH")).lineStream_!.headOption
    println(s"$value")

    Some(/usr/bin:/bin:/usr/sbin:/sbin)

I have used your workaround that you have mentioned, using absolute path. Thanks!

Process("/usr/local/bin/yarn", baseDirectory.value).!
mvillafuertem commented 4 years ago

I have found that this does not work from Jetbrains Toolbox. It's necessary to open it from the terminal open -na "IntelliJ IDEA.app"