Where to find which nodes were installed

My pi with node-red and the rest won't boot anymore after a powerfail.
I have a backup of my config but that comes with a lot of errors. Missing nodes.
Some are quite easy to find out what node it was (mysql) but others I cannot find.
(ui_tab, ui_base, ui_group, ui_link f.i.)
And the deveopment machine (pi) also hangs at boot.
I can read the old sd card with another pi.
But where can I find which nodes were installed?
Or can I just copy the .node-red and the .npm maps to my new sd card?
This is the list:
ui_tab
ui_group
ui_base
ui_link
MySQLdatabase
ui_spacer
zigbee2mqtt-server
ui_dropdown
aggregator
mysql
ui_chart
ui_date_picker
ui_form
ui_gauge
ui_slider
ui_text
ui_button
ui_switch
weekday
eztimer
ui_text_input
ui_numeric
ui_table
cronplus
ui_led
e-mail
zigbee2mqtt-bridge
zigbee2mqtt-in
zigbee2mqtt-out
zigbee2mqtt-get
Is there a map where I can find which nodes are installed?

Assuming you used the official installer script, then look in ~/.node-red/package.json

And if you restore package.json, then go into the .node-red folder and run
npm install
it will install any missing nodes. If you don't want the latest versions of them all then also restore package-lock.json before running npm install and it will install the same versions you had previously.

This flow will tell you everything. Just change the file paths in the read file nodes.

[{"id":"51fb56d2.8ca248","type":"inject","z":"d0860be6.7951b8","g":"68054db5.4e78b4","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"","payloadType":"date","x":95,"y":2760,"wires":[["1dd9f4ac.8347eb","b0df5fa0.7698b"]],"l":false},{"id":"1dd9f4ac.8347eb","type":"file in","z":"d0860be6.7951b8","g":"68054db5.4e78b4","name":"","filename":"./data/nrmain_flows.json","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"x":290,"y":2760,"wires":[["7db3c4dc.803e6c"]]},{"id":"b0df5fa0.7698b","type":"file in","z":"d0860be6.7951b8","g":"68054db5.4e78b4","name":"","filename":"./data/package.json","format":"utf8","chunk":false,"sendError":false,"x":250,"y":2880,"wires":[["b4c067a0.285bd8"]]},{"id":"7db3c4dc.803e6c","type":"json","z":"d0860be6.7951b8","g":"68054db5.4e78b4","name":"","property":"payload","action":"","pretty":false,"x":435,"y":2760,"wires":[["3aeb5629.c2b33a","9c8f63ea.e8083"]],"l":false},{"id":"3aeb5629.c2b33a","type":"change","z":"d0860be6.7951b8","g":"68054db5.4e78b4","name":"","rules":[{"t":"set","p":"totalNodes","pt":"msg","to":"$count(payload)\t","tot":"jsonata"},{"t":"set","p":"payload","pt":"msg","to":"payload^(type) {\t   `type`: $count([$])\t}","tot":"jsonata"},{"t":"set","p":"nodeTypesCount","pt":"msg","to":"$count($keys(payload))","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":515,"y":2760,"wires":[["5de6fbf7.a75344"]],"l":false},{"id":"5de6fbf7.a75344","type":"debug","z":"d0860be6.7951b8","g":"68054db5.4e78b4","name":"All Nodes (incl. Config.)","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"\"Nodes: \" & totalNodes & \", Types: \" & nodeTypesCount","statusType":"jsonata","x":690,"y":2760,"wires":[]},{"id":"97a2dead.fea94","type":"debug","z":"d0860be6.7951b8","g":"68054db5.4e78b4","name":"Nodes, Tabs, Subflows","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"\"N: \" & payload.totalNodesCount & \", Tabs: \" & payload.tabsCount & \", Subflows: \" & payload.subflowsCount","statusType":"jsonata","x":680,"y":2820,"wires":[]},{"id":"9c8f63ea.e8083","type":"function","z":"d0860be6.7951b8","g":"68054db5.4e78b4","name":"","func":"msg.totalNodes = msg.payload.length\n\nlet tabsCount = 0, subflowsCount = 0, nodeTypesCount = 0\nlet totalNodes = 0\nlet tabs = {}, subflows = {}, nodeTypes = {}\n\nmsg.payload.sort(function(a, b) {\n  var typeA = a.type.toUpperCase(); // ignore upper and lowercase\n  var typeB = b.type.toUpperCase(); // ignore upper and lowercase\n  if (typeA < typeB) {\n    return -1;\n  }\n  if (typeA > typeB) {\n    return 1;\n  }\n\n  // names must be equal\n  return 0;\n})\n\nmsg.payload.forEach((el) => {\n    if ( el.type === 'tab' ) {\n        tabsCount++\n        tabs[el.label] = el.id\n    } else if ( el.type === 'subflow' ) {\n        subflowsCount++\n        subflows[el.name] = el.id\n    } else {\n        nodeTypes[el.type] = nodeTypes[el.type]+1 || 1\n        totalNodes++\n    }\n})\n\nmsg.payload = {\n    'totalNodesCount': totalNodes,\n    'tabsCount': tabsCount,\n    'subflowsCount': subflowsCount,\n    'nodeTypesCount': Object.keys(nodeTypes).length,\n    'tabs': tabs,\n    'subflows': subflows,\n    'nodeTypes': nodeTypes,\n}\n\nreturn msg","outputs":1,"noerr":0,"x":515,"y":2820,"wires":[["97a2dead.fea94"]],"l":false},{"id":"b4c067a0.285bd8","type":"json","z":"d0860be6.7951b8","g":"68054db5.4e78b4","name":"","property":"payload","action":"","pretty":false,"x":435,"y":2880,"wires":[["dff7c57.77c4138"]],"l":false},{"id":"dff7c57.77c4138","type":"debug","z":"d0860be6.7951b8","g":"68054db5.4e78b4","name":"Package Dependencies","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload.dependencies","targetType":"msg","statusVal":"\"#: \" & $count($keys(payload.dependencies))","statusType":"jsonata","x":690,"y":2880,"wires":[]},{"id":"2d29205.cb6abe","type":"comment","z":"d0860be6.7951b8","g":"68054db5.4e78b4","name":"How Many Nodes in my flow?","info":"Don't forget to change the path to your flow file.\n\nNote the oddity regarding subflows. \nThey appear firstly as type \"subflow\" which is the\ndefinition, then again in the form\n\"subflow:<id>\" once for each instance of that\nsubflow `<id>` in your flows.\n\nI show both a JSONata and a function node\napproach to getting the data but note that\nthe JSONata version _is not quite correct_.\nIn the sense that it doesn't subtract the tabs\nand subflows from the overal counts.\n\nSo while the execution time of both approaches\nseems to be pretty identical, the function node\nis more comprehensive.","x":200,"y":2720,"wires":[]}]

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.