Upgrading node.js v8 to v10. Straight forward? Any recommended after install steps?

Hi all,

On windows, when upgrading Node.js from 8 LTS to 10 LTS, is there any specific steps I should/must take?

  • By this I mean should/must I re-run Node-red installer after node.js?
  • How about a contrib node that does a node-gyp step on install?
  • Possibility of running node.js 8 & 10 side by side?
  • Any bad experiences anyone?

Any advise appreciated and welcomed.

NOTE: I have searched the forum and have seen some people have had issues but I cant see any defined steps (I admit I spent only 5 mins looking but its a difficult one to pin down & I need to get this right 1st time).

Current node-red version is 20.5

Cheers.

I’ll readily admit I haven’t tried this on Windows so others will have to come in there. On Linux/Mac, nvm exists to keep multiple versions of Node running on the same machine. There have been several attempts to create a similar thing for windows. This one has 10k stars on GitHub, an active developer, and the documentation is pretty straightforward, leading me to think it might be worth a try. Especially as it keeps the version selected over reboots/updates the version to all open commandline prompts, and does not depend on node itself. For your other questions I do not have an answer.

I thought there was a bit about this in the docs, but I can't find it. In fact I can't find instructions for installing on Windows at all, which is a bit odd.

On a major update for any platform, you should rebuild your nodes. While this is not needed for all nodes (only for some that require compiling), it is safer to do it for everything.

Personally, I simply delete the <userDir>/node_modules folder and then reinstall:

npm install --production

Does that rebuild any nodes installed globally?

No, only the modules in your current project directory.

You need to use the -g switch for global modules.

1 Like

Yeah. Damn windows!

Thanks everyone for suggestions and info.

To summarize...

  1. Out of production hours
  2. Delete local node_modules (and global?)
  3. Upgrade node
    3.b probably upgrade node-red (may as well)
  4. npm install -g --production
  5. npm install --production

Seem correct? Any thoughts?

For the global part, best to also include --unsafe-perm which deals with odd permissions issues.

??? It isn't any harder than Linux. Also, if you want to (and are using W10), you can use the WSL and do everything in Linux too!

1 Like

I was referring to nvm

I have been using nvm-windows on my Win10 development machine at work for some time now. It uses those Windows symlinks to switch between versions.

The only annoying thing (or feature?) is, that it does not migrate your global packages. You have to install them manually with every new NodeJS version. I simply move or copy them over, when it is just a minor NodeJS version jump.

All in all, it works just fine. But since I am hardly ever using different Node versions at the moment, it is just for convenience in the upgrade process (in contrast to an MSI installer package or handling NodeJS versions manually) :grinning:

1 Like

Personally, I just stick with the current LTS version or thereabouts on my Windows dev machine. I need to get better at doing some testing though. My recent release of alternate-node-red-installer makes testing a lot easier since a simple command creates a new, completely clean installation of Node-RED in a new folder. If I need to test with another version of node.js, I can simply install that into WSL and test again from there.

I don't like faffing with any of the multi-version tools, I much prefer to stick with the official installs.

1 Like

I know of and have tried out WSL but I think I'm missing some understanding on how things fit together.

How do you achieve this? I'm curious as to what/where/how you install and executive against different node versions.

I feel I'm missing something. Can't quite get my head around what fits where regards WSL.

No problem.

WSL is a virtual Linux environment running under Windows 10. So you get a lightweight VM effectively.

So you can use WSL like any other Linux environment. Install node.js (and a version manager if you want to), then install Node-RED, etc.

Interestingly, I no longer use PuTTY - actually KiTTY - to connect to my Pi's. I use WSL with SSH command line client with a Windows shortcut to fire it up. This is actually faster! Go figure.

1 Like

Thanks for that one. :+1: Never heard of KiTTY, but it actually has a lot of features that I have missed in PuTTY for all the years. Will give it a try tomorrow at work... no Windows at home... fortunately. :sunglasses:

1 Like