Dear friends of Calva. Please consider subscribing to the CalvaTV channel on YouTube, and also like and comment a bit on the material. Hopefully that can make it a bit more visible there. https://www.youtube.com/calvatv (Of course, please tweet and such about the material as well. š )
I need help. Iāve been using Calva for a while, and Iām wondering if something is out of date or some dependency mismatch. Whenever I open or create a new project, I try to Jack-in and get this error:
clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"0.8.3"},cider/cider-nrepl {:mvn/version,"0.25.8"}}}' -A:test
/bin/sh: clojure: command not found
Jack-in process exited. Status: 127
Iām on mac, Big Sur, both Calva and VS Code are up to date (Iām pretty sure). What am I doing wrong? To fix this I have to quit VS Code and re-open my project, and that usually works, but sometimes not, and I canāt seem to have two projects going at the same time.
The error didnāt make it trough. š
I am still learning the Slack editor and how to hit return to add lines instead of submit the message. I think I got it.
I think you are running into the common problem that VS Code is not started with an environment that has the Clojure stuff available. Try starting VS Code from a terminal where you know you have clojure
on the path.
okay, that definitely worked. I had made myself an automator script so that I could right-click on a folder and open it in VS Code, and then sort of forgot that I had created that helper tool. I bet there is something with that tool that is not picking up the path/environment correctly. Iāll go investigate. Thanks for the help.
Question: When Iām in a āproblemā project, and jack-in is saying it canāt find clojure
command, I can still open a terminal (in the project), start nrepl (using the same options that jack-in would use, copied directly from the error message above, for example) and then use Calvaās āconnect to running REPL server in the projectā and that works okay. I donāt understand enough to know why of these two terminals within the VS Code project, one of them canāt find the clojure
command and let me jack in, but the other will let me manually start repl. Do you know what is going on? Itās probably a VS Code thing more than a Calva thing?
Not sure actually. At first I thought it was the same problem I have, that VS Code, when started from the MacOS Finder does not get the right environment. But now you tell me that from a terminal in the project the command works. Is that from a terminal, in the project, in VS Code? Or is it from a terminal outside VS Code?
On my last comment, I was talking about terminals within the project itself. VS Code built-in terminals.
BTW, Calva is awesome.
The Terminal opened inside VS Code is going to start up using your regular .profile
and other dot-files, so the path will be correct, and clojure
will be accessible.
macOS has always been a bit of a pain in regards to processes started from the Finder.
I always start VS Code from the Terminal via the code
command to avoid any of thatā¦
But then my Terminal usage is a bit heavy š
Sean, I attended the Provo meetup a few months ago and remember your terminal use was a bit out of control. Donāt know how you keep track of it allā¦
I also always start VS Code from the terminal. I think it is super strange that you can use the jack-in command from a VS Code terminal but that jack-in fails with that message. I have never seen that before. Jack-in shares the environment with VS Code, as I was sure the VS Code terminals also did.
Iāll try and get in the habit of using the code
from the command line, and as a backup, for when I forget to do that, I think I can manually start the REPL and then connect to it with Calva.
There is a command for copying the jack-in command to the clipboard. But still, super strange all this. Can you file an issue report from VS Codeās Help menu? It will attach some system info to the report that might shed some light on the mystery.