Fork me on GitHub
#shadow-cljs
<
2022-04-11
>
pinkfrog14:04:11

I am running with the aot version, specifically

{thheller/shadow-cljs$aot {:mvn/version "2.18.0"}}
There is a warning: WARNING: shadow-cljs not installed in project.

pinkfrog14:04:15

How can I disable it?

pinkfrog14:04:35

The command is npx shadow-cljs -d cider/cider-nrepl:0.27.4 watch :app

thheller16:04:04

@i that warning is about the npm shadow-cljs package not being installed in the project. which you should definitely do when using npx. so just npm install shadow-cljs. not related to the aot version in any way.

pinkfrog10:04:19

> which you should definitely do when using npx Why is it a necessity? The reason I use npx is that I do not need to install shadow.

pinkfrog10:04:32

The command works fine except the warning.

thheller18:04:43

> The reason I use npx is that I do not need to install shadow

thheller18:04:31

that makes no sense. if you use a tool you should install it. it also brings with it depenendencies that may be necessary. eg. for node-repl source maps and other stuff

pinkfrog04:04:06

I did a fresh install on a debian system, and just run npx shadow-cljs. The prompted as in the first picture. I then checked the directory _npx, i found the source-map and other dependencies are all installed.

thheller05:04:32

yes, in a place where shadow-cljs will not find it.

pinkfrog05:04:26

Not sure on the ‘will not found it’ part. Perform the following actions resulting the same directory layout.

mkdir -p test && cd test
npm install -D shadow-cljs

thheller05:04:38

yes, not how that node_modules/shadow-cljs dir is part of your project test dir. and the above in somewhere outside the project dir

pinkfrog05:04:40

Not sure what you are referring to. For the npx approach, it installs all the dependency. The only difference is, for the npx one, the shadow-cljs package is put in some-where/npx/modules, while the other approach installs shadow in $PROJ/nodemodules. Indeed the _npx/modules are outside the project path, but if it poses a problem, then its some erroneous logic of the library itself. For me, running npx shadow-cljs is all fine, except the shadow-cljs not installed in the project warning.

thheller05:04:31

ok simple test. create a :node-script build to output to the out directory in the project directory. run node out/whatever.js

thheller05:04:52

it'll fail because it also cannot find files in .npx, just as shadow-cljs does not look in ~/.npx when compiling

thheller05:04:41

yes running via npx works. but this is not at all what this warning is about. it is about compilation and running outputs. NOT about running shadow-cljs itself

thheller06:04:51

if you don't like it or want to ignore me just bypass running shadow-cljs completely

thheller06:04:41

clj -A:dev -M -m shadow.cljs.devtools.cli watch app is similar to npx shadow-cljs watch app. only server mode is not supported. as described https://code.thheller.com/blog/shadow-cljs/2017/11/18/the-many-ways-to-use-shadow-cljs.html

thheller06:04:02

that way you won't get the warning

thheller06:04:33

of course your build outputs will still fail to run without the missing dependencies

hairfire17:04:43

Noob question. Has anyone used sync-fetch from npm in a node.js app?