This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # bangalore-clj (1)
- # beginners (107)
- # boot (30)
- # braveandtrue (1)
- # cider (6)
- # cljs-dev (95)
- # cljsjs (16)
- # cljsrn (3)
- # clojure (107)
- # clojure-italy (15)
- # clojure-nl (2)
- # clojure-norway (3)
- # clojure-russia (1)
- # clojure-spec (39)
- # clojure-uk (54)
- # clojure-ukraine (1)
- # clojurescript (200)
- # code-reviews (2)
- # cursive (1)
- # datascript (1)
- # datomic (32)
- # editors (28)
- # gorilla (6)
- # graphql (8)
- # hoplon (1)
- # jobs (6)
- # jobs-discuss (5)
- # jobs-rus (1)
- # keechma (13)
- # leiningen (3)
- # luminus (6)
- # lumo (53)
- # off-topic (5)
- # om (13)
- # om-next (1)
- # onyx (56)
- # parinfer (7)
- # protorepl (22)
- # re-frame (47)
- # reagent (37)
- # remote-jobs (1)
- # ring-swagger (9)
- # specter (7)
- # yada (29)
I know and I want to install on
/usr/lib/node_modules ... In older versions, I was sucessfull.
if which nodejs; then nodejs scripts/npm_install.js; else node scripts/npm_install.js; fi (if there is some command called nodejs, use nodejs, else use node).
So just for anyone else who follows up on the earlier thread on using some npm git libraries: Turns out the trick for making the
Work wasn’t the addition of the
(def git ((js/require "simple-git") "./"))
"./"but the fact that the result of
(js/require "simple-git")needed to be executed as a function call. (This might be obvious to others but it wasn’t to me.) I put together what I learnt into an example git repo https://github.com/rberger/lumo-npm-example to help anyone else who comes along before there is more documentation. Would appreciate any feedback on what I might got wrong or could have done better! Thanks again for the help, I’m sure I’ll be back with more questions! :slightly_smiling_face:
@rberger that depends on the module, unfortunately the js world is not that straightforward regarding module require. So you required a module that exports a function (constructor) that when called returns the object.
@anmonteiro I think this is related to the change which requires clojure. to cljs.? There is no cljs.core.matrix, clojure.core.matrix is the entry point.
what may be confusing for you is the error, which says it can’t
cljs.core.matrix, could not locate cljs/core/matrix.cljs
but here’s the reason for that to happen: we tried loading
clojure/core/matrix.clj* and it failed
Yeah, that's why I figured it was related to. I also assumed clojurescript had either a whitelist or I should have been using cljs.string the whole time ;)
Makes sense. A shame it doesn't print everything it tried. I'm also surprised an error loading would cause it to error on found.
What is the restriction on self host here? What is preventing it from working I mean.
see the 2 links I pasted above. there’s a macro
vector-1d? that’s only defined in
(Just comparing to clojure's message there which is could not find x.clj, x.cljc or x.class)
Oh, I see. It's trying to do the self-require thing to get the clojure macros. That's always made my head spin a little. I misread, I thought it was including a cljs compatible version in cljs. And then defining it for clojure.
Yeah, it falls back from
cljs.* but perhaps it should distinguish between absolutely not being able to find the namespace, vs. finding it but having an error loading it.