I am trying to get nbb to download a dependency from Clojars. I am clearly not doing something correctly. Can anyone give me a pointer? Thanks in advance!
~/src/crisp/ground-up $ tree
.
├── README.md
├── bin
│ ├── dev_repl
│ ├── run_main
│ └── run_tests
├── nbb.edn
├── src
│ └── crisp
│ ├── core.cljs
│ └── wasm.cljs
└── test
└── crisp
└── crisp_test.cljs
6 directories, 8 files
_______________________________________________________________________
~/src/crisp/ground-up $ cat nbb.edn
{:deps
{deercreeklabs/baracus {:mvn/version "0.5.1"}}}
_______________________________________________________________________
~/src/crisp/ground-up $ cat src/crisp/wasm.cljs
(ns crisp.wasm
(:require
[applied-science.js-interop :as j]
[deercreeklabs.baracus :as ba]))
(def wasm-magic-number
(ba/byte-array [0 97 115 109]))
(defn data->wasm [data]
(js/Int8Array. [0 97 115 109 1 0 0 0]))
_______________________________________________________________________
~/src/crisp/ground-up $ cat bin/run_tests
#!/usr/bin/env nbb --classpath src:test
(require '[clojure.test :as t]
'[crisp.crisp-test]
'[nbb.classpath :as cp])
(t/run-tests 'crisp.crisp-test)
_______________________________________________________________________
~/src/crisp/ground-up $ bin/run_tests
----- Error --------------------------------------
Message: Could not find namespace: deercreeklabs.baracus
Could not find namespace: deercreeklabs.baracusyeah maybe try adding :paths ["src" "test"] in nbb.edn instead of setting the classpath?
I think that specifying a classpath will exclude the dep dir from the classpath. I don't do a ton of nbb, but if nbb.edn supports aliases, you might want a test alias that adds an extra path of test, and then include that alias instead of specifying the classpath
Nope, I think I'm wrong on that. But given the example listed, I am unable to repro this error. I get a different error that appears to come from when nbb tries to load baracus
if you just run nbb and try to require the namespace in the repl, does that download the dep (if it's not already downloaded) and is it possible to require the namespace and call a function in it?
also, the nbb readme indicates that it requires bb to be on the system path in order to download deps using nbb.edn - is that setup in place?
So it turns out that my problem was having an outdated version of nbb... Sorry for the wild goose chase.