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

**URL:** <https://discourse.nodered.org/t/how-to-solve-this-issue-when-im-trying-to-install-node-red-for-the-first-time/87147>\
**Category:** General\
**Created:** [11 April 2024 06:42 UTC](https://discourse.nodered.org/t/how-to-solve-this-issue-when-im-trying-to-install-node-red-for-the-first-time/87147 "2024-04-11T06:42:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nexto12](https://avatars.discourse-cdn.com/v4/letter/n/2acd7d/32.png) [@nexto12](https://discourse.nodered.org/u/nexto12)\
**Post date:** [11 April 2024 06:42 UTC](https://discourse.nodered.org/t/how-to-solve-this-issue-when-im-trying-to-install-node-red-for-the-first-time/87147/1 "2024-04-11T06:42:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [11 April 2024 07:19 UTC](https://discourse.nodered.org/t/how-to-solve-this-issue-when-im-trying-to-install-node-red-for-the-first-time/87147/2 "2024-04-11T07:19:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nexto12](https://avatars.discourse-cdn.com/v4/letter/n/2acd7d/32.png) [@nexto12](https://discourse.nodered.org/u/nexto12)\
**Post date:** [11 April 2024 07:26 UTC](https://discourse.nodered.org/t/how-to-solve-this-issue-when-im-trying-to-install-node-red-for-the-first-time/87147/3 "2024-04-11T07:26:03Z")

</div>

it happens to shows the same error

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [11 April 2024 08:07 UTC](https://discourse.nodered.org/t/how-to-solve-this-issue-when-im-trying-to-install-node-red-for-the-first-time/87147/4 "2024-04-11T08:07:52Z")

</div>

> [@nexto12](#):
>
> Error: spawn EINVAL

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

```auto
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`.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [11 April 2024 09:13 UTC](https://discourse.nodered.org/t/how-to-solve-this-issue-when-im-trying-to-install-node-red-for-the-first-time/87147/5 "2024-04-11T09:13:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [10 July 2024 09:14 UTC](https://discourse.nodered.org/t/how-to-solve-this-issue-when-im-trying-to-install-node-red-for-the-first-time/87147/6 "2024-07-10T09:14:19Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
