fix loading node package in nodesDir on linux

fixes #3861
This commit is contained in:
Steve-Mcl
2022-09-03 21:23:38 +01:00
parent 5365786386
commit d6bb3a558f
3 changed files with 40 additions and 20 deletions

View File

@@ -156,6 +156,16 @@ function scanDirForNodesModules(dir,moduleName,package) {
}
}
}
// if we have found a package.json, this IS a node_module, lets see if it is a node-red node
if (!isNodeRedModule && files.indexOf('package.json') > -1) {
package = getPackageDetails(dir) // get package details
if(package && package.isNodeRedModule) {
isNodeRedModule = true
files = ['package.json'] // shortcut the file scan
}
}
for (let i=0;i<files.length;i++) {
let fn = files[i];
if (!isNodeRedModule && /^@/.test(fn)) {