Uninstall custom node

#1

Hi, i've created some customs nodes and linked with my local node-red server using:

sudo npm link my-custom-node

But now I want to remove 1 of them from my modules. I tried use

sudo npm uninstall my-custom-node-to-remove
And
sudo npm remove my-custom-node-to-remove

But that deleted all the nodes I've created. There is a way to do what I want?

0 Likes

#2

I'm not clear what you mean.

Do you have:

  1. one module that contains lots of nodes and you want to remove one of them from the module.
  2. or, lots of modules, each of which you've used npm link to install and you want to remove one of those modules?

What version of npm are you using?

0 Likes

#3

Npm Version: 6.4.1

I'm newbie, so if understand correctly I've done the 2 option ("lots of modules, each of which you've used npm link to install and you want to remove one of those").
To better explain, I've followed the creting node tutorial, so I've created some folders each one having 3 files:

  • One .html
  • One .json
  • One .js

After that I've used npm link for each of these. But now, I want to remove just one of them.

0 Likes

#4

Could this be caused by the fact that recent versions of npm may without warning remove nodes that are not included in package.json? So the npm remove command is removing one node, but then npm is removing the rest because they have not been included in the package?

0 Likes

#5

Thanks guys, the problem was as Colin said. When I manually include the dependency on package.json, the remove works perfectly.

0 Likes

#6

It seems like a possible deficiency in npm that it does not update package.json when you use link.

0 Likes