# Installing in WSL2

**URL:** <https://discourse.nodered.org/t/installing-in-wsl2/65617>\
**Category:** General\
**Created:** [26 July 2022 00:52 UTC](https://discourse.nodered.org/t/installing-in-wsl2/65617 "2022-07-26T00:52:35Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![HaroldPetersInskipp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haroldpetersinskipp/32/42319_2.png) [@HaroldPetersInskipp](https://discourse.nodered.org/u/HaroldPetersInskipp)\
**Post date:** [26 July 2022 00:52 UTC](https://discourse.nodered.org/t/installing-in-wsl2/65617/1 "2022-07-26T00:52:35Z")

</div>

I did a quick search, and found some instructions here: [https://discourse.nodered.org/t/how-to-run-node-red-on-windows-10-wsl-linux-subsystem/](https://discourse.nodered.org/t/how-to-run-node-red-on-windows-10-wsl-linux-subsystem/)

Just checking to see if this info is up to date before proceeding?

I tried running `sudo -d install node-red` but got:

```auto
sudo: invalid option -- 'd'
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-T timeout] [-u user] file ...

```

Is the [alternate-node-red-installer](https://github.com/TotallyInformation/alternate-node-red-installer) my only option?

I would've asked there, but the topic is closed.

---

<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:** [26 July 2022 01:27 UTC](https://discourse.nodered.org/t/installing-in-wsl2/65617/2 "2022-07-26T01:27:40Z")

</div>

Node-RED is a node.js app so you can install it by doing `npm install node-red --unsafe-perm` in a convenient folder. You can also do the usual `npm -g install node-red --unsafe-perm` to install it globally if you prefer.

It is unlikely that Dave's Pi install script will work because WSL doesn't include systemd I don't think.

My alternate installer simply installs node-red locally as in the first command I gave. But it sets up the folder and some other conveniences for you as well.

In all cases, you need to have installed node.js first and possibly `npm install -g build-essentials` (not sure about that last, been a while since I installed on WSL.

---

<div class="post-metadata">

**Author:** ![HaroldPetersInskipp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haroldpetersinskipp/32/42319_2.png) [@HaroldPetersInskipp](https://discourse.nodered.org/u/HaroldPetersInskipp)\
**Post date:** [26 July 2022 02:06 UTC](https://discourse.nodered.org/t/installing-in-wsl2/65617/3 "2022-07-26T02:06:22Z")

</div>

Cool, global install it is then.  
Ran `npm -g install node-red --unsafe-perm`, everything went well, and seems to work as intended.

It seems `npm install -g build-essentials` is not of any use for WSL installations.

Thank you.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 July 2022 16:35 UTC](https://discourse.nodered.org/t/installing-in-wsl2/65617/4 "2022-07-26T16:35:28Z")

</div>

@TotallyInformation is there a typo in option 2 in the link in the first message above ?

---

<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:** [26 July 2022 19:24 UTC](https://discourse.nodered.org/t/installing-in-wsl2/65617/5 "2022-07-26T19:24:14Z")

</div>

Quite possibly - what typo?

---

<div class="post-metadata">

**Author:** ![HaroldPetersInskipp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haroldpetersinskipp/32/42319_2.png) [@HaroldPetersInskipp](https://discourse.nodered.org/u/HaroldPetersInskipp)\
**Post date:** [26 July 2022 20:25 UTC](https://discourse.nodered.org/t/installing-in-wsl2/65617/6 "2022-07-26T20:25:18Z")

</div>

@TotallyInformation I believe he is referring to the command `sudo -d install node-red` as I'm not sure what that is supposed to be.

---

<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:** [26 July 2022 20:42 UTC](https://discourse.nodered.org/t/installing-in-wsl2/65617/7 "2022-07-26T20:42:50Z")

</div>

Oh right, yes I just ignored that as it was the wrong command of course, I gave the right one.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 July 2022 20:51 UTC](https://discourse.nodered.org/t/installing-in-wsl2/65617/8 "2022-07-26T20:51:02Z")

</div>

Would it be worth correcting the original posting at [https://discourse.nodered.org/t/how-to-run-node-red-on-windows-10-wsl-linux-subsystem/](https://discourse.nodered.org/t/how-to-run-node-red-on-windows-10-wsl-linux-subsystem/) (which you wrote I believe, in case you hadn't noticed).

---

<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:** [26 July 2022 20:58 UTC](https://discourse.nodered.org/t/installing-in-wsl2/65617/9 "2022-07-26T20:58:48Z")

</div>

Oh, well why didn't someone tell me it was my text! 😃

Corrected.

---

<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:** [9 August 2022 20:59 UTC](https://discourse.nodered.org/t/installing-in-wsl2/65617/10 "2022-08-09T20:59:18Z")

</div>

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