Installation of Node Red on Windows

Is there any kind of installation guide for Node Red on Windows 11 that actually works. Installing the Node.js package always stops and fails at the point where it's trying to run a setup.exe file I'm assuming for Visual Studio, once I get to the point of running it I can't install a bunch of nodes because it can't find Visual Studio Tools. The npm install -g --unsafe-perm node-red never installs anything because it's all Deprecated. I've been working on this for two days now and I'm beyond frustrated.

It really is both stupid and brutal that this has to be so difficult to get working. I need this for work but I'm at the point where I don't want to use this at home personally.

Install Steps I follow. Always done after a clean Windows Install.

Update Powershell (I've tried not updating it as well)
Install Visual Studio 2022
Install Node.js
Run npm install -g --unsafe-perm node-red
I've also tried npm install --global --production windows-build-tools plus hundreds of searches with suggestions that just don't work.

  1. Use CMD instead of powershell
  2. When you install node.js, make sure you tick the box that states install the necessary tools for compiling (windows-build-tools is the old depreciated way)
  3. You don't need to install Install Visual Studio 2022 (if you followed previous step)
  4. I'd personally go with node v20 LTS (don't use odd numbered versions of node js)
  5. Make sure you install the latest version of node-red (v4.0.8). There may be one or two depreciated warnings, but that does not mean it did not work. It just means since the version was released, some dependencies are no longer being maintained. As time goes by and new versions of node-red are released, we will address them as we can.

Point of note: this is a lot smoother on Linux (especially Debian/ Ubuntu variants). Windows is just a pain but professionally, I have installed and used node-red many times on Windows. The real problem comes when you need to run it as a service and understanding node/npm global installations are not really global to the system but in fact global to the user and you need to reinstall everything again as the final service account.

  1. When I install Node.js it opens Powershell on it's own and I seem to have no way to force it to use CMD.
  2. I've ticked that box on every install attempt I've made.
  3. I will give it a go, what does LTS stand for.
  4. Is there somewhere to download Node-Red instead of using the CMD string so I can make sure I have the latest version.

PowerShell is the current default shell - it makes little difference but is a more modern experience than the cmd shell.

Have you installed Node.js correctly? What version is installed and did you install the build tools when prompted?

If your PC is blocking installation of the build tools - is it a work managed PC?

I was referring to when you install node-red as per the docs for windows

npm install -g --unsafe-perm node-red

Long Term Support - in short, use even numbered versions of NodeJS (20 or 22 LTS)

Not really, Node does not work like that. you use NPM (Node Package Manager)

I've seen NPM installations fail on PS.

How would that happen? If the OP ticks the box, the required components are in the Node MSI package arent they?

Not sure about stupid and brutal but I completely agree that installing Node-red is not simple on Windows. Yet people do run it on a PC.

An alternative approach might be to buy a Raspberry Pi Zero 2 and 32gB micro SD card (total maybe £20).
Access the OS command line by ssh.
Put RaspiOS Lite on it, install node, npm and Node-red all in one using the official script.
Use a browser on your PC to run NR editor and dashboard.

I will give this a try and see what happens.

Thanks for your replies.

I have a Pi 5 that I've done the install on but I've run into an issue that I can't seem to solve. Here's the link to that posting.

I'd appreciate any help solving this issue.

Thanks

One more thing, I have a working install on my personal laptop however I can't get it to work on my work laptop. This is a small business and it is not a work managed PC.

I've seen reference to running Lubuntu on a PC for Node-Red. What would you recommend as an OS for this?

Thanks

I would not personally run Linux on a laptop solely so it can easily run Node-red

I'm sure it works fine but my Node-red server has to run 24 hours a day and Pi is the perfect device for that.

We don't know the cause of your arduino difficulty.
If trying to switch to PCs is because you believe Raspberry Pies are unsuitable, you are probably barking up the wrong tree.

Never happened to me in many years of use :slight_smile: And shouldn't happen since it has been the default shell for some years now.

No, it is a separate executable provided by Microsoft. The node.js installer simply downloads and runs it for you.

Here's what I do to get node-red quickly running in a recent Windows 10 or Windows 11 VM (where the winget app is present by default):

  • Open PowerShell
  • Run this command:
    winget install OpenJS.NodeJS.LTS
  • Restart PowerShell, otherwise the path for node and npm isn't available in the console
  • Change the execution policy, so my local user account can actually run npm:
    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
  • Check the versions that got installed:
    node --version; npm --version
  • Install Node-RED
    npm install -g --unsafe-perm node-red
  • Start Node-RED
    node-red
  • If I want to use the Projects feature, I edit the settings.js and install Git :
    winget install --id Git.Git -e --source winget
    ... then restart Node-RED.

Does that install the build tools in case a node that requires building is installed?

I have the same question as Colin. Will the build tools be installed for those nodes that require it?

Thanks for the detailed install process.

Or just run the official installer from the node.js website - it doesn't hurt to re-run anyway.

Winget is currently showing an earlier minor version as the "upgrade" than the version I actually have installed.

I haven't encountered the need for this, but no, the Windows build tools are not included.

There's also a winget option for this:
winget install --id=Microsoft.VisualStudio.2022.BuildTools -e

This doesn't give you chocolatey BTW.

BTW, I noticed I got the order wrong: you have to change the ExecutionPolicy before you can run npm --v. I'll edit my previous post here.

You need it for any npm install that requires a C/C++ library compile. Things like SQLite, serial port, .... - it is possible that you already have the required apps if you've used that PC for Visual Studio development.

UPDATE

I think I found a method that works.

  1. Install Visual Studio 2022 and select the Node.js and Desktop Development with C++ Modules.
  2. Reboot
  3. Follow RvG's installation instructions.
  4. Install Python 3.13.1

I'm now able to install Nodes that require the VS Build Tools.

Not sure if the Node.js module is required but I installed it anyway. I'm now able to connect to my Arduino loaded with Firmata by creating a Com Port in Node Red.

Thanks everyone for your help, everything seems to be working properly now. I couldn't have done it without all of your help.