UIBUILDER package.json error

Just noticed this in my v7.4.3 UIBUILDER package.json file;

  "path": "/home/ubuntu/.node-red/uibuilder",
  "error": {
    "code": "ELSPROBLEMS",
    "summary": "missing: @totallyinformation/web-components@^1.2.0, required by uib_root@7.4.3\nmissing: justgage@^1.7.0, required by uib_root@7.4.3\nmissing: plotly.js-basic-dist-min@^3.0.1, required by uib_root@7.4.3",
    "detail": ""
  },

The packages are however installed and working fine otherwise I wouldn't see my charts & gauges.
There are no browser console or node-red log errors reported.
Could it be related to Installed Libraries not showing in Library tab · Issue #556 · TotallyInformation/node-red-contrib-uibuilder · GitHub ?

Full UIBUILDER package.json

{
  "version": "7.4.3",
  "name": "uib_root",
  "description": "Root configuration and data folder for uibuilder",
  "scripts": {},
  "homepage": "",
  "bugs": "",
  "author": "",
  "license": "Apache-2.0",
  "repository": "",
  "uibuilder": {
    "packages": {
      "@totallyinformation/web-components": {
        "spec": "^1.2.0",
        "installFolder": "/home/ubuntu/.node-red/uibuilder/node_modules/@totallyinformation/web-components",
        "installedVersion": "1.2.0",
        "estimatedEntryPoint": "?",
        "homepage": "https://www.npmjs.com/search?q=@totallyinformation/web-components",
        "packageUrl": "/@totallyinformation/web-components",
        "url": "../uibuilder/vendor/@totallyinformation/web-components/?",
        "scope": "@totallyinformation/web-components",
        "installedFrom": "npm",
        "outdated": {
          "current": "1.2.0",
          "wanted": "1.3.1",
          "latest": "1.3.1"
        }
      },
      "justgage": {
        "spec": "^1.7.0",
        "installFolder": "/home/ubuntu/.node-red/uibuilder/node_modules/justgage",
        "installedVersion": "1.7.0",
        "estimatedEntryPoint": "?",
        "homepage": "https://www.npmjs.com/search?q=justgage",
        "packageUrl": "/justgage",
        "url": "../uibuilder/vendor/justgage/?",
        "installedFrom": "npm",
        "outdated": {}
      },
      "plotly.js-basic-dist-min": {
        "spec": "^3.0.3",
        "installFolder": "/home/ubuntu/.node-red/uibuilder/node_modules/plotly.js-basic-dist-min",
        "installedVersion": "3.0.3",
        "estimatedEntryPoint": "?",
        "homepage": "https://www.npmjs.com/search?q=plotly.js-basic-dist-min",
        "packageUrl": "/plotly.js-basic-dist-min",
        "url": "../uibuilder/vendor/plotly.js-basic-dist-min/?",
        "installedFrom": "npm",
        "outdated": {
          "current": "3.0.3",
          "wanted": "3.1.0",
          "latest": "3.1.0"
        }
      },
      "raphael": {
        "spec": "^2.3.0",
        "installFolder": "/home/ubuntu/.node-red/uibuilder/node_modules/raphael",
        "installedVersion": "2.3.0",
        "estimatedEntryPoint": "?",
        "homepage": "https://www.npmjs.com/search?q=raphael",
        "packageUrl": "/raphael",
        "url": "../uibuilder/vendor/raphael/?",
        "installedFrom": "npm",
        "outdated": {}
      }
    }
  },
  "path": "/home/ubuntu/.node-red/uibuilder",
  "error": {
    "code": "ELSPROBLEMS",
    "summary": "missing: @totallyinformation/web-components@^1.2.0, required by uib_root@7.4.3\nmissing: justgage@^1.7.0, required by uib_root@7.4.3\nmissing: plotly.js-basic-dist-min@^3.0.1, required by uib_root@7.4.3",
    "detail": ""
  },
  "devDependencies": {},
  "peerDependencies": {},
  "_id": "uib_root@7.4.3",
  "dependencies": {
    "@totallyinformation/web-components": "^1.2.0",
    "justgage": "^1.7.0",
    "plotly.js-basic-dist-min": "^3.0.3",
    "raphael": "^2.3.0"
  }
}

Oh, strange! I think that must have cropped up at some previous point in your experiments. Since uibuilder does its best to preserve that file (in case you choose to install dependencies outside of Node-RED), that property has been retained.

Of course, that error property should never have been written into the file in the first place so that is a minor bug somewhere. The error comes from the npm ls command so at some point you had an issue with an installed package which might have happened for all sorts of reasons. The error should have been logged rather than ending up in the JSON file! :smiley:

I think that if you remove the whole error property from the file (best to close node-red to be safe, then manually edit the file and restart node-red - overkill but better safe than sorry). It should not reappear but let me know if it does.

I've some work to do on the library manager anyway now that I've just added the new feature in 7.5 that now lets you run npm scripts defined in the package.json file in your uibuilder instance root. This is to allow things like build scripts to be run if you want to optimise code or use a front-end framework that requires a build such as Svelte or REACT. In doing that work, I discovered some new ways of being able to wrap async calls in a way that works with ExpressJS allowing data to be carried across multiple async calls. Perfect for handling npm runs. That has allowed me to grab npm command outputs as a returned http stream back into the Editor.

So I may want to do something similar for the library manager - which uses my same library functions. So it will be easier to see what is going on when you install/update/remove front-end libraries. Not sure if that will make it into v7.5 though, probably will wait till v7.6.

Anyway, thanks for spotting and reporting that. I will make a note to see if I can track down where it might happen. Anyway, the good news is that it should have no impact on Node-RED or uibuilder. :smiley:

1 Like

Before I moved to a SPA model, I had 3 instances of UIBUILDER, each serving a separate page, and the libraries were manually added to their respective instance at ../.node-red/uibuilder/instance/src/libs (I didn't use the 'Libraries' feature in the UIBUILDER node), so maybe that caused it.
In any event, I've deleted the error property, and it has not returned.

Thanks Julian

Well, that shouldn't have made a difference. There is a clear delineation in uibuilder between the different contexts (node-red, uibuilder global, and uibuilder instances). There shouldn't be any interaction between them.

Anyway, I've made a note to check for possible causes.

1 Like