Question regarding <https://commandbox.ortusbooks....
# box-products
m
Question regarding https://commandbox.ortusbooks.com/v/5.4.0/package-management/updating-packages: what's wrong if neither
list
nor
outdated
is working (latest commandbox version 5.6.1)? error message is
C:\Users\chucknorris\Projects\commandbox\ is not a package!
b
@megger It means there are no system modules installed, and therefore there is not a
box.json
in that folder.
What version of CommandBox are you on however-- I'm fairly sure I put in a fix several versions ago to ensure that box.json would always be present, even if empty.
So I'm curious how you managed to even get that error.
Also 5.4.0 is two versions (and a year) of CommandBox behind. Is there a reason you're using an old version of the docs?
m
@bdw429s just googled that docs page and didn't recognize that is the old version related. anyway, https://commandbox.ortusbooks.com/package-management/updating-packages . i assumed that if no CommandBox.json is present the on in my .CommandBox folder is being used? i'm pretty sure that this file is in use, because i can see the enabled config options for module https://www.forgebox.io/view/commandbox-update-check in this file...
m
Happens also with the latest version. According to the latest version of the updating packages commands don't work: list, update, outdated. All of them return an 'is not a package!' error without any more information. Is there some 'verbose' option to see what's happening?
b
@megger no commandbox.json is not the same as box.json. There are totally different files.
@madmike_de there is no debug/verbose option lile what you're asking, but I don't understand what info you're looking for. If there's no box.json in CommandBox's cfml directory, that simply means you use modules are installed! Just install one and the the fine still be created!
I'll have to check why a default box.json is not being created, but the fact that it's not there should not cause any real issues.
It will be created the first time you install a system module like cfconfig
m
Ok, what did we want to achive: I'd like to find out which of the installed modules are outdated. So we tried the updatecheck module from forgebox. But it doesn't work with 6.5., but did with 5.4.2
b
I confused because if there isn't any box.json, then there aren't any modules!
You can't check if something that isn't there is outdated
m
there's a lot of stuff outdated, but it's in the artifacts folder in the commandbox system folder.
m
if we install new modules we see a box.json and a modules directory in the folder where commandbox.exe is
b
Huh, we're taking about different things here, lol
Artifacts aren't "outdated". Their just back ups of downloads
@megger yes, that is correct... And what I've been saying all along
m
but if we remove all artifacts and install preside-commands or https://www.forgebox.io/view/commandbox-update-check then these modules don't appear in the modules dir
b
You'll need to show me what you mean. I'm not following
No, you're looking in the CURRENT folder
You have you use the --system flag if you want to work with the modules which install until the commandbox cfml home
I have no idea what that modules folder is in your screenshot. That's not anything in use by CommandBox!
You seem very confused, lol
I'm on my phone making coffee. If you give me a bit I can help better.
m
the modules directory was added after
install date-utility
of course, no need for speed, relax!
b
Right, but I think your running install commands in the wrong place
Why are you installing modules into a random folder that contains box.exe, this makes no sense.
App modules go into your actual cf webroot
And system modules are put in the commamdbox home automatically.
And note, the folder with box.exe is NOT the commandbox home!
m
okay, wan't aware of the difference between app and system modules
i know that my Commandbox home is in .CommandBox. There's the palce where i find my servers.json and the CommandBox.json
anyway...our original goal was to see whether the preside-commands are outdated (https://www.forgebox.io/view/preside-commands) @madmike_de and me struggled with this problem and hoped to solve it with the update-check module (https://www.forgebox.io/view/commandbox-update-check ) - without success 😞
b
@megger Right, so ANY folder with a
box.json
is a package, plain and simple. This means you can have hundreds of packages all over your hard drive. All of your projects are probably a package. Commandbox's
cfml
folder is ALSO a package where "system" modules are installed that the CLI core itself uses, not to be confused with modules you install into a given web root.
So, if you want to see what packages are installed in a give directly, you run
Copy code
list
and if you want to see if any of those packages in the current directory are outadated, you run
Copy code
outdated
Furthermore, if you want to see what system packages are installed into the CommandBox core you run this (from any directory you want)
Copy code
list --system
and if you want to see if any of those system packages in the CommandBox core are outdated, you run this (again from any dir you want)
Copy code
outdated --system
Any time you run ANY package command in a folder which is not a package, you will get a message that the folder is not a package. Simple
Adding the
--system
flag ONLY defaults the working directory the command runs against to be the
cfml
folder in the commandbox core. That's all
So if you run
Copy code
list --system
and CommandBox tells you the commandbox core is not a package, it means no system package have been installed.
Now, CommandBox is SUPPOSED to always have a box.json in there, but it seems that isn't working correctly. But that's really just for your convenience
m
Now it totally makes sense. And this is what is missing in the documentation. Thanks for the explanation.
b
NOW--- if you believe you have installed some system packages, but when you run
Copy code
list --system
you get the error, then something is amiss and we should troubleshoot whether you really installed system packages or not!
And finally, all the update check module does is run the
Copy code
outdated --system --hideUpToDate
command for you. There's no difference between that and you running it yourself.
I'll happily merge any updates to the docs which you think will help clarify this. The command help for these commands also lists all of these parameters and what they do
Copy code
list ?
outdated ?
m
A little hint saying that
list
shows 'only' the packages of the current folder and that there are more options would help.
Never thought about, that these commands have options too
b
The help for the
list
command says this already
Lists all dependencies of a package recursively. Run this command from the root of the package.
So it's tied to the folder it's run from
Just npm does
m
thanks for the detailed explanation 🙂
really time for a new cfcamp and commandbox session :-)
b
Really time for CFCamp! 😉