How to upgrade nrepl version of leiningen?

冷暖自知 提交于 2019-11-28 06:43:13
rntz

I've just had this problem, and I solved it by adding an explicit dependency on the newer version of tools.nrepl to profiles.clj. My ~/.lein/profiles.clj:

{:repl {:plugins [[cider/cider-nrepl "0.9.0-SNAPSHOT"]]
        :dependencies [[org.clojure/tools.nrepl "0.2.7"]]}}

No idea whether that's the best or official way to do it, tho'.

an additional note on top of @matthew-moss's: the tools.nrepl dependency line is only used if you run lein repl from within a clojure project. if you just run lein repl from your home directory, for example, you end up using the version of tools.nrepl that is compiled into leiningen. No idea why.

Hope that saves somebody time.

lein has an upgrade command so in the simplest case

lein upgrade

In case you installed leiningen with a package manager you might need to do something like the below (example for OS X, linux distros have their own wonderful package managers):

brew unlink leiningen
brew update
brew install leiningen

As an addition to the accepted answer: adding dependency on 0.2.7 in user profiles.clj worked for me some days ago but then suddenly I got back to the 0.2.6 warning. Asking "lein deps :tree" had this line in it:

[org.clojure/tools.nrepl "0.2.7" :scope "test" :exclusions [[org.clojure/clojure]]]

Which gave me a clue that probably the lein-test-refresh plugin (defined in the same profiles.clj) is causing some confusion here. Reading some more about profiles I learnt about the ^:replace hint. This line in dependencies works now for me:

^:replace [org.clojure/tools.nrepl "0.2.7"]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!