Open darwin opened 8 years ago
Might be related to https://github.com/cursive-ide/cursive/issues/906.
I have a similar issue with the custom Leiningen plugin which fires automatically and executes pnpm install
.
This plugin is triggered as expected when Cursive IDE scans the projects. But it fails because pnpm
cannot be found.
It turns out that the env vars, and PATH
in particular, are not set as expected when the plugin is executed:
"PATH" "/usr/bin:/bin:/usr/sbin:/sbin"
On macOS pnpm
can be installed via brew
or npm
(which in turn can be installed via nvm
). So on dev machines pnpm
actually can reside at /opt/homebrew/bin/pnpm
or ~/.nvm/versions/node/v22.7.0/bin/pnpm
and these paths are not on the PATH
set by Cursive IDE.
This is probably a more general problem of IntelliJ IDE on macOS, looking at issues like https://youtrack.jetbrains.com/issue/IDEA-347122/PATH-in-terminal-doesnt-contain-some-of-configured-paths .
It looks like PATH variables are not applied to all shell interactions done by Cursive
Shortly after opening a project with particular project.clj, the IDE reports unhandled exception. The problem is leiningen code choking on
LEIN_SNAPSHOTS_IN_RELEASE
error.Recently I was forced to use a SNAPSHOT-dependency on specter library. This started those LEIN_SNAPSHOTS_IN_RELEASE issues. I could set LEIN_SNAPSHOTS_IN_RELEASE in my bash shell environment to silent it on command-line, but that does not apply to GUI apps like IntelliJ.app. Using PATH variables would be convenient here, but didn't work in this particular case. I had to resort to
launchctl setenv LEIN_SNAPSHOTS_IN_RELEASE 1
, which is global and does some magic. Once I set it I wasn't able to unsetenv-it. Maybe after restart? Anyways. I have a workaround to my particular issue.In this report I'm asking for Cursive code review and making sure that all shell or leiningen library interactions respect PATH variables from IntelliJ.
https://www.jetbrains.com/help/idea/2016.2/path-variables-2.html