Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Creating a cljs REPL from terminal using deps.edn and clj command
;; Save this file as deps.edn in some directory that doesn't already
;; have such a file.
;; You must have the following installed for the command below to have
;; a chance of working:
;; + A JDK, e.g. from AdoptOpenJDK web site:
;; + Clojure CLI tools. Install instructions here:
;; + Node.js JavaScript runtime environment. Some prepackaged ways to
;; install:
;; + Ubuntu 18.04 Linux: `sudo apt-get install nodejs`
;; + macOS
;; + plus Homebrew: `brew install node`
;; + plus MacPorts: `sudo port install nodejs10`. You can see
;; other versions available via the command `port list | grep
;; nodejs`.
;; clj -m cljs.main --repl-env node
;; If that is successful, you should eventually see output like this:
;; $ clj -m cljs.main --repl-env node
;; ClojureScript 1.10.520
;; cljs.user=>
;; At the REPL, I could evaluate these forms without errors:
;; (require '[clojure.core.matrix :as m])
;; (require '[clojure.core.matrix.dataset :as d])
;; I have not tried using the core.matrix library any more extensively
;; than that, yet.
;; In the directory where you run this, a .cpcache directory will be
;; created by clj to cache information about dependencies.
{:deps {org.clojure/clojurescript {:mvn/version "1.10.520"}
net.mikera/core.matrix {:mvn/version "0.62.0"}}
{:socket {:jvm-opts ["-XX:-OmitStackTraceInFastThrow"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment