Installing on Windows Server 2022 - I've installed on many other windows versions without issue, I'm not sure if this is an issue with this install of Windows or a problem with the current node-red.
I originally installed using
npm install -g --unsafe-perm node-red
and the latest NodeJS v20.
I've since tested using NodeJS v18 and back to early versions of Node-red 3.1 - they all seem to present with the same error. I've also downloaded node-red, extracted, installed manually and hit the same error using:
npm install
npm start
===================
11 Apr 13:31:43 - [info] Node-RED version: v3.1.8
11 Apr 13:31:43 - [info] Node.js version: v18.20.2
11 Apr 13:31:43 - [info] Windows_NT 10.0.20348 x64 LE
11 Apr 13:31:43 - [error] Failed to start server:
11 Apr 13:31:43 - [error] Error: spawn EINVAL
at ChildProcess.spawn (node:internal/child_process:414:11)
at spawn (node:child_process:761:9)
at Object.execFile (node:child_process:351:17)
at C:\node\node-red\node_modules\@node-red\registry\lib\installer.js:581:27
at new Promise (<anonymous>)
at Object.checkPrereq (C:\node\node-red\node_modules\@node-red\registry\lib\installer.js:580:16)
at Object.load (C:\node\node-red\node_modules\@node-red\registry\lib\index.js:59:22)
at C:\node\node-red\node_modules\@node-red\runtime\lib\index.js:162:29
Most odd. I'm now wondering if this is a windows update or recent nodejs issue. I have installed v3.0.x ~ V4beta on win 11 with node 18 many times without issue.
This is a pretty fresh Server 2022 install, it is not part of a Domain so there won't be any customised group polices etc - I'm logged in as Administrator which is still a local admin.
I've been running the NodeJS installer and NPM commands as this user, executing the node-red.cmd with "Run as Administrator" makes no difference.
NodeJS was run by just double clicking the installer.
I'm attempting to remove everything again and perhaps try as a different user.
I also can't see anything obvious in the Windows event logs regarding security etc.
You shouldn't need to uninstall anything but it won't harm either.
This was going to be my last suggestion but I seen others did not run with account named Administrator - worth a shot though.
This is very odd indeed.
In your trials, would you also please try a specific node version: v18.19.0 - I have this on my development machine and it rings node-red without issue.
That's the version that works for me. From your posts I guess you used the latest LTS of v20 and v18. I am super curious to know if the latest node version is to blame.
Cna you please specify how did you uninstall everything in NPM? Which prompt did you use? With remove Nodejs, you mean uninstall, right? I am going to repeat your steps, as I have the same issue.