Hi
i'm missing something with that part in package json file:
"node-red": {
"version": ">=3.1.1",
"plugins": {
"commonFunctions": "/nodes/commonFunctions.js"
},
I want the user not to be able to install my node, if node-red version is below 3.1.1. I thought that was enough to put a "version" key in the json file, but either it doesn't work, or i've misunderstood such key.
Is there a way to stop the installation/update of a node, if node-red version is below 3.1.1?
Thanks
Hi,
I tried that locally (without install) and it works
"node-red": {
"nodes": {},
"version": ">=4.0.0"
}
But the installer
module does not seem to verify it!
Hi GogoVega
Thank you for your answer and to point me out the source code.
@knolleary Nick, can you check that? Thank you very much.
Nick, to resolve this case, I believe we can add the version to satisfy in the catalog?
We can even modify the UI to clearly indicate that this module is not authorized?
I saw that it ignore here (not useful here but always good to know):
function checkAgainstList(module,version,list) {
for (var i=0;i<list.length;i++) {
var rule = list[i];
if (rule.module.test(module)) {
// Without a full semver library in the editor,
// we skip the version check.
// Not ideal - but will get caught in the runtime
// if the user tries to install.
return rule;
}
}
}
I think it can be done here:
if (updateAllowed &&
semVerCompare(loadedIndex[module].version,moduleInfo.version) > 0 &&
RED.utils.checkModuleAllowed(module,null,updateAllowList,updateDenyList)
) {
nodeEntry.updateButton.show();
nodeEntry.updateButton.text(RED._('palette.editor.update',{version:loadedIndex[module].version}));
} else {
nodeEntry.updateButton.hide();
}
I show the update button, disable it and change the tooltip message
This version must also be included in the catalog
system
Closed
24 March 2024 10:20
6
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.