How to properly uninstall a locally installed node?

So I was testing some changes to my new node-red-contrib-life360 node. I have a copy of the package in ~/temporary and to install it, I did:

sudo npm install -g

That seemed to work. the new node showed up in node red, but I noticed some things I wanted to edit and I wanted to start fresh, so I did the reverse (but I realized that I had to add the package name because it still showed in npm ls -g --depth=0):

sudo npm uninstall -g node-red-contrib-life360

However, after doing this, though the package is no longer shown in npm ls -g --depth=0, I still see it in node red...

How do I uninstall a local package in such a way that it disappears from the node-red interface?

Have you restarted node-red?

If you have what do these commands show, run from your .node-red folder (important!).
npm list node-red-contrib-life360
and
npm list -g node-red-contrib-life360

Hmmm... So there's a complication. Originally, I npm published as an scoped package with the name @hepcat72/node-red-contrib-life360 due to issues with spam filter triggering. I since had the npm folks allow me to publish it as un-scoped, but the local package I'm working with still has the scoped name.

I didn't realize when I did the uninstall before that it wasn't working. It never reported removed 1 package in 2.24s, although I swear the npm ls -g output changed. So I ran:

sudo npm uninstall -g @hepcat72/node-red-contrib-life360

and got the removed message output and now node-red shows the package as gone!

So I figured it out.

Learned some more about uninstalling that was causing me grief...

If you don't delete config nodes of something you uninstall like this (above), any parent repo's node you're trying to distinguish the type info of (i.e. registered type must differ between the parent and forked repo), then when you restart node red, your parent repo's nodes will stop because the node with the conflicting type won't load and node red equates the two...

I had to re-install the edited node and then delete the config node, then uninstall again...

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