This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-01
Channels
- # announcements (1)
- # babashka (1)
- # beginners (49)
- # calva (111)
- # chlorine-clover (2)
- # cider (2)
- # circleci (9)
- # clojure (60)
- # clojure-europe (25)
- # clojure-nl (4)
- # clojure-taiwan (2)
- # clojure-uk (10)
- # code-reviews (5)
- # conjure (1)
- # cryogen (2)
- # cursive (1)
- # data-science (1)
- # datomic (1)
- # figwheel-main (1)
- # fulcro (23)
- # hoplon (2)
- # malli (4)
- # meander (1)
- # off-topic (149)
- # other-languages (1)
- # re-frame (40)
- # reagent (27)
- # reitit (2)
- # shadow-cljs (25)
- # slack-help (4)
- # spacemacs (7)
- # xtdb (11)
I'm working with a package that has an alternate way to install for its "nightly" build. I've cloned the package repo to my local drive and built the package (actually it builds multiple packages but in my example I'm only using one.) The local repo serves up the package via a http interface using a simple Python server. I can then install the package using npm install
with the dependency in my project package.json file of `"@ndn/packet": "http://localhost:8000/packet.tgz"`. The package installs properly but fails when I run shadow-cljs to compile. I have tested using this package with webpack and node.js so I am confident that the Javascript stuff is working properly. Is there something I need to do with shadow-cljs to get this to work?
The compile fails with the following error:
(parallels) (27)# shadow-cljs compile app
shadow-cljs - config: /media/psf/DataPartition/lastmile/ttncore/shadow-cljs.edn
[:app] Compiling ...
npm package "@ndn/packet" expected version "@ndn/tlv@http://localhost:8000/tlv.tgz" but "0.0.20201213-nightly-eb9e062" is installed.
[:app] Build completed. (225 files, 6 compiled, 0 warnings, 11.57s)
npm ls
reports the following:
(parallels) (28)# npm ls | more
[email protected] /media/psf/DataPartition/lastmile/ttncore
├─┬ @babel/[email protected]
│ └── [email protected]
├─┬ @ndn/[email protected]
│ ├─┬ @ndn/[email protected]
And here's a snippet from my package.json file:
"dependencies": {
"@babel/runtime": "^7.12.5",
"@ndn/packet": "
@dmaltbie [:app] Build completed. (225 files, 6 compiled, 0 warnings, 11.57s)
the build succeeded? the "expected version" thing is just a warning?
It appears so. And the code seems to work. Should I ignore these warnings? I don't get them when I compile with webpack or node.
I'm not seeing that. Where would that be specified (which file)?
I can't find a file in the project named deps.cljs. my shadow-cljs.edn file contains two cljsjs packages. could that cause a problem?
:dependencies
[
[cljsjs/hash "1.1.3-0"]
[cljsjs/msgpack-lite "0.1.26-0"]
[reagent "1.0.0-alpha2"]
[reagent-utils "0.3.3"]
]
you don't need to include those cljsjs
deps since shadow-cljs will not use them anyways
you can set :npm-deps {:install false}
. then it won't warn or attempt to install npm dependencies from deps.cljs
. something in your dependencies or you project has a deps.cljs
file which declares a :npm-deps
dependency on "@ndn/packet"
with version "@ndn/tlv@http://localhost:8000/tlv.tgz"
The package.json file for @ndn/packet (in the node_modules directory) has a dependency for the tlv.tgz file. But there isn't a deps.cljs file. And I thought I needed to have the package version specified in the shadow-cljs.edn file for packages I use. Are you saying that I should just install with npm instead of cljsjs?
Where does the :npm-deps
statement go?
Ok. I see in the User Guide section 5.2.2 that it says to use npm to manage the JS packages and not cljsjs. got it. But I still can't find where to put the :npm-deps
statement. Do I put it in my main.cljs file or create a deps.cljs file?
you must have a deps.cljs files somewhere. its the only file that causes those warnings. it might be in one of the cljsjs dependencies though so if the warning goes away after removing them its probably one of those
I expect this is my bonehead problem, but I can't get the :npm-deps option to work. I've tried several ways with no success. I even tried it in a deps.cljs file in the src directory. Can you please look at my shadow-cljs.edn file and tell me what I'm doing wrong? You'll see I've tried it in various places in the .edn file just to see if I misplaced it. No luck.
Also, I've searched for the deps.cljs file but I'm not finding one. (used find
starting from root and grep
to search the source tree).
Thanks.
at the top level the one is just fine. are you maybe on an old version that doesn't have this flag?
Here's what I've got:
(parallels) (157)# shadow-cljs info
shadow-cljs - config: /media/psf/DataPartition/lastmile/ttncore/shadow-cljs.edn
=== Version
jar: 2.11.11
cli: 2.11.11
deps: 1.3.2
config-version: 2.11.11
=== Java
openjdk version "11.0.9.1" 2020-11-04
OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)
Also in my package.json I have (is this necessary?):
"devDependencies": {
"onchange": "^7.1.0",
"shadow-cljs": "^2.11.11",
"tailwindcss": "^1.9.6"
},
looks fine to me. I don't know what is up with your setup but again you can ignore the warning. it has no impact on the build whatsoever.
Ok. Thanks for your help.
Just curious, is there is a way to examine the option settings for a given runtime of the compiler?
not sure I understand the question? which "runtime" are you talking about abnd which settings?
hey, I just released version 2.11.12
which should get rid of the warning you asked about. it doesn't compare versions using http: etc anymore
in addition there is a :js-options {:check-versions false}
to turn the check off completely (true by default)
That worked for me!! Thanks. I really appreciate being able to weed out the extraneous warnings so that I can see any others with less clutter. Big Thumbs Up!