Answered - Clear Missing Dependencies

G'day all,

I've ran into a few issues that I will try to address one at a time. I'm not sure if this first item is a bug with Node-RED, or if I'm just doing it wrong.

ISSUE: Unable to remove node package after I've added then removed a node from a flow.

DETAILS: Trying to figure out how to use ElasticSearch with Node-RED (issue #2) and trying all the various projects listed in the palette. When I install a package, apply a node to a flow to test, and then remove it when it doesn't work, I am unable to remove the package from the management window. The only way to remove it is by calling npm remove <package> on the host system. However, after I do this I notice the following error when I list available node modules using npm list:

npm ERR! missing: node-red-contrib-elasticsearch-continued@~0.1.0, required by node-red-project@0.0.1
npm ERR! missing: node-red-contrib-elasticsearch7@0.0.7, required by node-red-project@0.0.1

So my QUESTION - how to resolve that issue? And more specifically, how do I remove a node package from Node-RED using the palette manager when I am no longer using it. I've search through my flows for any references to these modules and cannot find them referenced anywhere. And if that is not an option, where is this dependency listed? What file/folder/location is holding the information for node-redproject@0.0.1?

Thanks for your assistance - and I hope to learn enough to contribute back to the community.

Dan

I'm guessing you know most of this...

To remove a node using the palette manager
Menu > Manage palette

On the Nodes tab, any nodes that you have installed but are not being used will have the following options
remove disable all
Clicking remove will bring up a dialogue

Removing '<NODE NAME>'

Removing the node will uninstall it from Node-RED. 
The node may continue to use resources until Node-RED is restarted.

Clicking on the Remove button
then starts the actual remove.

But you can only do this if there are no nodes deployed AND you have deleted any config nodes for the node, you can delete orphaned config nodes using Menu > Configuration Nodes to list them (click on unused to see any for nodes that aren't being used)

Thanks for the quick response to my query.

Yes, I've looked in the manage palette area, and when I've removed the node and any configurations from my flow, it is still listed as "in use" and will not allow me to remove it. That is why I went the route of using the npm remove route. Once I've executed that command the module is no longer listed in the Manage palette page.

Dan

Then take a look at the package.json file in your .node-red directory

There's an option in npm to remove a package from the project's dependencies
npm uninstall --save

If you've definately removed all instances from your workspace AND removed all instances from Menu - Configuration Nodes - and hit deploy - and it still says it's in use (and can't be removed) then that is an issue for that node developer - as it should have then let go of everything by then.

Next option is as you surmised to use npm uninstall - but use the --save option as @ukmoose suggests.

Thank you - that was what was missing. Neither package cleared their dependency entries from the projects package.json file.