Fork me on GitHub
#lumo
<
2019-11-30
>
vigilancetech10:11:52

Can anyone tell me why the second example program on this page can't find the randomUser.json file (even tho its right in CWD)? https://itnext.io/command-line-scripting-with-clojurescript-5e5567367713

sogaiu14:11:39

@vigilancetech if i understood what you were referring to correctly, it seems to work for me

sogaiu14:11:47

it's the program that creates randomUser.edn, right?

vigilancetech18:11:14

I'm trying to get it to work in msys2 if that helps. I've tried it without the "./" leading the "randomUsers.json" in case there's an issue with forward and back slashes

vigilancetech18:11:51

I haven't tried it with a ".\" however (or ".\\" whatever)

vigilancetech18:11:21

generally I haven't found that to be an issue when writing cljs under msys2 yet however

vigilancetech18:11:47

$ ls
node_modules/  NUL  package.json  package-lock.json  randomUsers.json  src/

$ ./src/my_tool/foo.cljs
Cannot find module './randomUsers.json'
         Function.Module._resolveFilename (internal/modules/cjs/loader.cljs:655:15)
         Function.Module._load (internal/modules/cjs/loader.cljs:580:25)
         Module.require (internal/modules/cjs/loader.cljs:711:19)
         require (internal/modules/cjs/helpers.cljs:14:16)
         Object.<anonymous> (C:NaN:3)
         Module._compile (internal/modules/cjs/loader.cljs:805:30)
         ()
         (Object.lumo.repl.caching_node_eval)
         (NO_SOURCE_FILE <embedded>:6029:9)
         z (NO_SOURCE_FILE <embedded>:6030:22)

sogaiu18:11:29

it sounds like you're trying in windows -- is that right? haven't tried there.

vigilancetech19:11:35

msys2 is kind of a quasi-windows/quasi-linux. The programs are windows exe's but the paths have been finessed from Unix paths

sogaiu20:11:57

when my machine is less burdened, i'll see if i can reproduce in a windows vm

sogaiu20:11:47

@vigilancetech i don't have vanilla msys2, but i do have what one gets with git bash. there and via windows powershell (didn't try core), execution successfully created randomUsers.edn for me

sogaiu20:11:20

this was in a windows 10 vm. i installed nvm via scoop and got node 8.16.2 to test. lumo was installed using npm install -g lumo-cljs

vigilancetech20:11:59

thanks, yeah I just had a problem with msys2 and node. It was unsupported by it's project manager so I installed node via its latest .msi file. Maybe my version is *too new

vigilancetech20:11:24

I'm running node v13.2.0

vigilancetech20:11:37

@sogaiu what is your lumo version?

sogaiu21:11:22

@vigilancetech

Lumo 1.10.1
ClojureScript 1.10.520
Node.js v11.13.0
 Docs: (doc function-name-here)
       (find-doc "part-of-name-here")
 Source: (source function-name-here)
 Exit: Control+D or :cljs/quit or exit

cljs.user=>

sogaiu21:11:03

interestingly, when i do node --version right after i get: v8.16.2

vigilancetech23:11:47

yeah, I have the same lumo version

vigilancetech23:11:42

guess I'm gonna try and open that file with a function and see if it also has a path issue