Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to start shadow-cljs project #591

Closed
Looveh opened this issue Mar 18, 2020 · 10 comments
Closed

Unable to start shadow-cljs project #591

Looveh opened this issue Mar 18, 2020 · 10 comments

Comments

@Looveh
Copy link

Looveh commented Mar 18, 2020

Issue Type: Bug

Try starting a shadow-cljs project with:

C-M-c C-M-j > shadow-cljs > :app

Getting the error:

> Executing task: npx shadow-cljs -d cider/piggieback:0.4.2 -d cider/cider-nrepl:0.23.0 watch :app <

/bin/bash: npx: command not found
The terminal process terminated with exit code: 127

Terminal will be reused by tasks, press any key to close it.

Project config:

; shadow-cljs.edn
{:deps
 {:aliases [:dev]}

 :builds
 {:app
  {:target           :react-native
   :init-fn          my.app/init
   :output-dir       "out"
   :compiler-options {:infer-externs :auto}
   :devtools         {:autoload true}}}}

; deps.edn:
{:paths
 ["src/"]

 :deps
 {reagent              {:mvn/version "0.9.0-rc3"}
  re-frame             {:mvn/version "0.11.0-rc3"}
  thheller/shadow-cljs {:mvn/version "2.8.81"}}

 :aliases
 {:dev {:extra-paths ["src/"]}}}

Extension version: 2.0.85
VS Code version: Code 1.43.0 (78a4c91400152c0f27ba4d363eb56d2835f9903a, 2020-03-09T19:34:44.548Z)
OS version: Darwin x64 19.3.0

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 2300)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 16.00GB (0.10GB free)
Process Argv
Screen Reader no
VM 0%
@hindol
Copy link

hindol commented Mar 19, 2020

If you open a terminal in VSCode, can you run npx? If it is not found, then that's your problem.

@PEZ PEZ added the jack-in label Mar 19, 2020
@PEZ
Copy link
Collaborator

PEZ commented Mar 19, 2020

@Looveh If you do which npx in a terminal outside of vsocde, and examine thePATH variable in a vscode integrated shell, does it contain the path?

@Looveh
Copy link
Author

Looveh commented Mar 19, 2020

When I open VSCode as you'd open any other application on Mac, npx isn't found on the path. If I open it using code in bash, it's there as expected.

@hindol
Copy link

hindol commented Mar 19, 2020

@Looveh That is because if you open VSCode from bash, all environment variables (including $PATH) are retained. You can try changing the default shell in VSCode to bash.

@PEZ PEZ added the upstream label Mar 19, 2020
@PEZ
Copy link
Collaborator

PEZ commented Mar 19, 2020

This looks a bit relevant: microsoft/vscode#30847 (comment)

Not sure what Calva can do about it, except instructions on how to fix it (or work around it, if that is the best we can do).

@PEZ
Copy link
Collaborator

PEZ commented Mar 19, 2020

Also, @Looveh . Is lein's location on your $PATH in the integrated terminal, but not npx?

@hindol
Copy link

hindol commented Mar 19, 2020

@PEZ Regarding the linked comment, in MacOS one can update /etc/paths or /etc/paths.d/<some-file> so that both the OS and terminals have access to it. This way, inconsistencies can be avoided.

If someone uses other ways to update $PATH, for example via .profile, .bash_profile, .bashrc (assuming bash), then VSCode launched using the app icon will not have access to this additions.

StackExchange: https://unix.stackexchange.com/questions/356688/what-is-the-difference-between-echo-path-and-etc-paths/356720

@PEZ
Copy link
Collaborator

PEZ commented Mar 19, 2020

🙏

I've been using OSX since it was in its first beta, but haven't stumbled across this problem before. 😄

@PEZ
Copy link
Collaborator

PEZ commented Mar 21, 2020

I added some info about this to the docs: https://calva.readthedocs.io/en/dev/quirks.html#command-not-found-errors-on-jack-in

@PEZ PEZ closed this as completed in 9c9df76 Mar 21, 2020
@bpringe
Copy link
Contributor

bpringe commented Aug 18, 2020

Updating the link to where this is documented, since I was just updating docs and followed the link to this issue: https://calva.io/quirks/#command-not-found-errors-on-jack-in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants