dundalek / closh

Bash-like shell based on Clojure
Eclipse Public License 1.0
1.62k stars 66 forks source link

Does not work #51

Closed alekseysotnikov closed 6 years ago

alekseysotnikov commented 6 years ago

I am zero in Node JS. Could someone advice me what need to do to fix it?

$ npm install -g lumo-cljs closh
/usr/local/bin/closh -> /usr/local/lib/node_modules/closh/bin/closh.js
/usr/local/bin/lumo -> /usr/local/lib/node_modules/lumo-cljs/bin/lumo.js

> lumo-cljs@1.8.0 install /usr/local/lib/node_modules/lumo-cljs
> node scripts/npm_install.js || nodejs scripts/npm_install.js

 Downloading [========================================] 2961197/bps 100% 0.0s

+ closh@0.1.3
+ lumo-cljs@1.8.0
added 3 packages, removed 1 package, updated 2 packages and moved 64 packages in 22.908s
$ closh
Could not require closh.core in file closh/main.cljs
     (new)
     Function.cljs.core.ex_info.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:2024:72)
     Function.cljs.analyzer.error.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:2639:92)
     (NO_SOURCE_FILE <embedded>:5950:320)
     (Object.lumo.repl.run_sync_BANG_)
     Object.cljs.js.process_deps (NO_SOURCE_FILE <embedded>:5927:185)
     Object.cljs.js.process_libs_deps (NO_SOURCE_FILE <embedded>:5930:60)
     (NO_SOURCE_FILE <embedded>:5948:474)
     (Object.lumo.repl.run_sync_BANG_)
     Object.cljs.js.process_deps (NO_SOURCE_FILE <embedded>:5927:185)

Could not locate the bindings file. Tried:
 → /usr/local/lib/node_modules/closh/node_modules/deasync/build/deasync.node
 → /usr/local/lib/node_modules/closh/node_modules/deasync/build/Debug/deasync.node
 → /usr/local/lib/node_modules/closh/node_modules/deasync/build/Release/deasync.node
 → /usr/local/lib/node_modules/closh/node_modules/deasync/out/Debug/deasync.node
 → /usr/local/lib/node_modules/closh/node_modules/deasync/Debug/deasync.node
 → /usr/local/lib/node_modules/closh/node_modules/deasync/out/Release/deasync.node
 → /usr/local/lib/node_modules/closh/node_modules/deasync/Release/deasync.node
 → /usr/local/lib/node_modules/closh/node_modules/deasync/build/default/deasync.node
 → /usr/local/lib/node_modules/closh/node_modules/deasync/compiled/9.2.0/darwin/x64/deasync.node
     bindings (/usr/local/lib/node_modules/closh/node_modules/bindings/bindings.cljs:88:9)
     (/usr/local/lib/node_modules/closh/node_modules/deasync/index.cljs:34:32)
     Object.<anonymous> (/usr/local/lib/node_modules/closh/node_modules/deasync/index.cljs:76:2)
     Module._compile (module.cljs:641:30)
     Object.Module._extensions..js (module.cljs:652:10)
     Module.load (module.cljs:560:32)
     tryModuleLoad (module.cljs:503:12)
     Function.Module._load (module.cljs:495:3)
     Module.require (module.cljs:585:17)
     require (internal/module.cljs:11:18)

$ node -v
v9.5.0
$ npm -v
5.6.0
dundalek commented 6 years ago

I don't run Mac so I am not able to test it. Maybe installing node using nvm might help.

I am working on an alternative build process (see #42) which means that installing would be just downloading a single file, which should prevent these kind of issues in the future.

borkdude commented 6 years ago

It worked before on my Mac, but I get the same error after doing npm install -g lumo-cljs closh.

borkdude commented 6 years ago

@alekseysotnikov FWIW, I messed around with brew unlink node && brew link node a bit and then it worked again.

domparry commented 6 years ago

Same problem here on a mac... Sad, because I'm really keen to use closh!

borkdude commented 6 years ago

Here's the transcript of what I did to make it work.

Borkdude@MacBook-Pro-2  $ closh
Could not require closh.core
     (new)
     Function.cljs.core.ex_info.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:2024:72)
     Function.cljs.analyzer.error.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:2639:92)
     (NO_SOURCE_FILE <embedded>:5950:320)
     (Object.lumo.repl.run_sync_BANG_)
     Object.cljs.js.process_deps (NO_SOURCE_FILE <embedded>:5927:185)
     Object.cljs.js.process_libs_deps (NO_SOURCE_FILE <embedded>:5930:60)
     (NO_SOURCE_FILE <embedded>:5948:474)
     (Object.lumo.repl.run_sync_BANG_)
     Object.cljs.js.process_deps (NO_SOURCE_FILE <embedded>:5927:185)

Could not locate the bindings file. Tried:
 → /usr/local/lib/node_modules/closh/node_modules/deasync/build/deasync.node
 → /usr/local/lib/node_modules/closh/node_modules/deasync/build/Debug/deasync.node
 → /usr/local/lib/node_modules/closh/node_modules/deasync/build/Release/deasync.node
 → /usr/local/lib/node_modules/closh/node_modules/deasync/out/Debug/deasync.node
 → /usr/local/lib/node_modules/closh/node_modules/deasync/Debug/deasync.node
 → /usr/local/lib/node_modules/closh/node_modules/deasync/out/Release/deasync.node
 → /usr/local/lib/node_modules/closh/node_modules/deasync/Release/deasync.node
 → /usr/local/lib/node_modules/closh/node_modules/deasync/build/default/deasync.node
 → /usr/local/lib/node_modules/closh/node_modules/deasync/compiled/9.2.0/darwin/x64/deasync.node
     bindings (/usr/local/lib/node_modules/closh/node_modules/bindings/bindings.cljs:88:9)
     (/usr/local/lib/node_modules/closh/node_modules/deasync/index.cljs:34:32)
     Object.<anonymous> (/usr/local/lib/node_modules/closh/node_modules/deasync/index.cljs:76:2)
     Module._compile (module.cljs:641:30)
     Object.Module._extensions..js (module.cljs:652:10)
     Module.load (module.cljs:560:32)
     tryModuleLoad (module.cljs:503:12)
     Function.Module._load (module.cljs:495:3)
     Module.require (module.cljs:585:17)
     require (internal/module.cljs:11:18)

Borkdude@MacBook-Pro-2 $ brew link --overwrite npm
Warning: Already linked: /usr/local/Cellar/node/9.5.0
To relink: brew unlink node && brew link node
Borkdude@MacBook-Pro-2 $ brew unlink node && brew link node
Unlinking /usr/local/Cellar/node/9.5.0... 7 symlinks removed
Linking /usr/local/Cellar/node/9.5.0...
Error: Could not symlink bin/closh
Target /usr/local/bin/closh
already exists. You may want to remove it:
  rm '/usr/local/bin/closh'

To force the link and overwrite all conflicting files:
  brew link --overwrite node

To list all files that would be deleted:
  brew link --overwrite --dry-run node
Borkdude@MacBook-Pro-2 $ brew unlink node && brew link --overwrite node
Unlinking /usr/local/Cellar/node/9.5.0... 0 symlinks removed
Linking /usr/local/Cellar/node/9.5.0... 884 symlinks created
Borkdude@MacBook-Pro-2 $ closh
$ (+ 1 2 3)
6
$ exit
domparry commented 6 years ago

Ok. I seem to have something else wrong:

➜  ~ closh
readlink: illegal option -- f
usage: readlink [-n] [file ...]
usage: dirname path
/Users/domparry/.nvm/versions/node/v9.6.0/bin/closh: line 10: realpath: command not found
usage: dirname path
usage: dirname path
/Users/domparry/.nvm/versions/node/v9.6.0/bin/closh: line 15: /lumo: No such file or directory
/Users/domparry/.nvm/versions/node/v9.6.0/bin/closh: line 15: exec: /lumo: cannot execute: No such file or directory
➜  ~
domparry commented 6 years ago

OK. Mine is solved. I was attempting to install dundalek/closh version to get tab completion... installing just closh works...

mnewt commented 6 years ago

@domparry That's a different issue. I just created #52 to track that.

dundalek commented 6 years ago

This should not happen anymore, please open a new issue if another installation error appears.