Calva Error "LSP classpath lookup failed when running `lein with-profile +test,+dev classpath`. "

637 views Asked by At

I would like to use vs code as development environment for clojure.

I'm opening guestbook project in vs code.

As soon as the project is opened in vs code I get error pop up.

LSP classpath lookup failed when running `lein with-profile +test,+dev classpath`. Some features may not work properly if ignored. Error: Cannot run program "lein" (in directory "/Users/rnatarajan/Documents/Coding/others/clj-web-dev/c01/guestbook"): error=2, No such file or directory Choose an option:

calva vs code error

I'm also getting below details in VS code output -

Calva is utilizing cider-nrepl and clojure-lsp to create this VS Code experience.
  nREPL dependencies configured:
    nrepl: 1.0.0
    cider-nrepl: 0.28.5
    cider/piggieback: 0.5.3
  clojure-lsp version configured: latest

If you are new to Calva, please see: https://calva.io/getting-started/
  And please consider the command: **Calva: Fire up the Getting Started REPL**

Calva version used: v2.0.350
2

There are 2 answers

1
Jethro Larson On

You probably just need in install clojure. Follow the instructions here: https://clojure.org/guides/install_clojure

0
Orodiel On

I've stumbled upon a similar error but with a different root cause. In your case it appears that VS Code is unable to launch lein (which is the build tool for the specified project). Make sure Leiningen is installed and added to the PATH.

P.S. I've encountered a similar issue when clojure-lsp tried to calculate classpath for the project which have abandoned project.clj and deps.edn at the same time (as a result of migration from lein to clojure tools). Had to create a config file and specify appropriate 'classpath scan' option.