Node module update issue

Was it not the fact that you had installed two versions and remove took out one but not the other?

I think the original command needs updating - I think it should be

cd ~/usr/lib/node_modules/node-red
sudo npm uninstall --unsafe-perm node-red-node-email

I'll fix the docs

What happens the next time you run the update-nodejs-and-nodered script?
I think it will install node-red-node-email@0.1.29 again because of the dependency
node-red-node-email": "0.1.* in the package.json

hmmm yes - quicker we get to 0.20 the better.

As @cflurin mentioned, I can confirm that updating node-red brings back the old modules. I experienced this after I individually updated email module to 1.0.1 and then later updated the entire node-red which in a result replaced email module back with 0.1.29

@dceejay Thanks for the tip. The command you mentioned actually did work nicely, though I had to change the path a bit. It should run inside

/usr/lib/node_modules/node-red

1 Like

Thanks - edited my post above so as not to confuse others.
Also we are looking at a better fix that will hopefully be in 0.19.3

Windows 10 user... I cannot uninstall "node-red-node-email" in order to upgrade it...
"mpn uninstall -g node-red-node-email" won't uninstall the package.
How do I do this with Windows 10 if that syntax is wrong?

Kind Regards.

Check your spelling
npm - "Node Package Manager"
mpn - may refer to: Manufacturer part number says the Google
:wink:

2 Likes

sometimes you get reality to hit you pretty hard.. the problem is it's when you least expect it.

OK I checked to see if I used the incorrect syntax on the system. I didn't.

npm uninstall -g node-red-node-email

and it replied...
up to date in 0.047s

but did not uninstall anything.
shows node-red-node-email as 0.1.29
an update is available as 1.0.4
I cannot update, I get an error.

"Failed to update: node-red-node-email
Module not locally installed
Check the log for more information"

I'm not sure how to proceed. I'm guessing I just have to use the older version.

I'm not expert on npm in any way, but have you tried it in the way that was suggested earlier in this topic by dceejay?

cd ~/usr/lib/node_modules/node-red
npm uninstall --unsafe-perm node-red-node-email

not quite what I said... may need an extra sudo with that command...

For windows user I did removed the sudo. Is it ok, I don't know.

Ah - for a windows user you may need to be in admin mode... other way is to find the node-red-node-email directory and just zap it :slight_smile: (then restart node-red)

For windows users!
The node-red-node-email folder to delete is located at:
C:\Users\YourUserName\AppData\Roaming\npm\node_modules\node-red\node_modules

1 Like

My experience is this:

Find your global npm root folder

npm -g root

Then navigate to the node-red/node_modules folder below that.

Then

npm uninstall --unsafe-perm node-red-node-email

Restart node-red (you get a warning the module is missing), then install it via the palette manager. Also fully refresh the browser window (shift refresh).

You will find the same issue with the -rbe and the -twitter node.

YMMV

If you are on 0.19.4 or later you do not need to uninstall these modules. Just install the later versions in your user directory and restart Node-RED. It will use the version from your user directory in preference to those globally installed.

Is there an option to use the palette manager (to add the newer version node in the user dir) instead of adding it via the cmd prompt?

I have answered this lots of times recently.

In 0.19.4 you can manually install in your user directory and NR will ignore the globally installed version

In 0.20 you will be able to do the upgrade straight from the palette manager - and it will so the local install for you.

1 Like