How to solve this issue when im trying to install node red for the first time?

11 Apr 14:34:15 - [info] Node-RED version: v3.1.8
11 Apr 14:34:15 - [info] Node.js version: v20.12.2
11 Apr 14:34:15 - [info] Windows_NT 10.0.22631 x64 LE
11 Apr 14:34:15 - [error] Failed to start server:
11 Apr 14:34:15 - [error] Error: spawn EINVAL
at ChildProcess.spawn (node:internal/child_process:421:11)
at spawn (node:child_process:761:9)
at Object.execFile (node:child_process:351:17)
at C:\Users\User\AppData\Roaming\npm\node_modules\node-red\node_modules@node-red\registry\lib\installer.js:581:27
at new Promise ()
at Object.checkPrereq (C:\Users\User\AppData\Roaming\npm\node_modules\node-red\node_modules@node-red\registry\lib\installer.js:580:16)
at Object.load (C:\Users\User\AppData\Roaming\npm\node_modules\node-red\node_modules@node-red\registry\lib\index.js:59:22)
at C:\Users\User\AppData\Roaming\npm\node_modules\node-red\node_modules@node-red\runtime\lib\index.js:162:29

There is another recent thread that was resolved by installing a different version of nodejs.

Try installing NodeJS 18.19.0 then re-install node-red.

Please let us know if this works for you.

it happens to shows the same error

Having once installed Node-RED globally, changing node.js versions probably won't help unless you then rebuild the installation.

npm rebuild -g

You may need admin rights for that to work.

If it still fails after that, you might need to track down the package-lock.json file and delete it. You could also try npm cache clean --force.

The latest versions of Node 18/20 include a security fix that has broken Node-RED on Windows.

We'll have a fix for Node-RED later today.

1 Like