Node module update issue

Installing module:

waqas@aslam:~/.node-red$ npm i node-red-node-email
npm WARN deprecated mailparser@0.6.2: Mailparser versions older than v2.3.0 are deprecated
npm WARN deprecated mimelib@0.3.1: This project is unmaintained
+ node-red-node-email@1.0.1
added 19 packages from 12 contributors in 1.47s

Showing local listing:

waqas@aslam:~/.node-red$ sudo npm ls node-red-node-email
node-red-project@0.0.1 /home/waslam/.node-red
└── node-red-node-email@1.0.1 

Showing global listing:

waqas@aslam:~/.node-red$ sudo npm ls -g node-red-node-email
/usr/lib
└─┬ node-red@0.19.2
  └── UNMET DEPENDENCY node-red-node-email@0.1.*

npm ERR! missing: node-red-node-email@0.1.*, required by node-red@0.19.2

Looks like my global listing is messed up.

did you restart node-red and check the node-red-node-email version?

It looks fine in node-red UI with correct version.

Seems like I've fixed the global listing issue by removing

"node-red-node-email": "0.1.*",

from package.json file in /usr/lib/node_modules/node-red

and now this is what I get when print global listing:

/usr/lib
└── (empty)

which means there's no such package installed globally.

I did also remove the dependency but I think we should ask @knolleary or @dceejay for the best praxis.
Maybe update package.json?

I wonder if you need to do a remove not uninstall

I'm not sure I undestand you.
I just did an uninstall following the doc but actually it doesn't uninstall (probably because it's installed in the node-red path) so I've removed the folder with all the included files manually.

Ahh never mind, remove is an alias of uninstall

Though I've fixed my issue the hard-way (by deletion and altering package.json), I still wonder why isn't it possible to remove node-red-node-email@0.1.29 at first place by issuing the uninstall command?
Any feedback on this will be appreciated as I have another machine to update and I don't feel the urge to go that path for a number of modules :neutral_face:

No, remove is the linux cmd rm (= delete).

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.