# How to install node-red from scratch

**URL:** <https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753>\
**Category:** General\
**Created:** [7 March 2020 12:19 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753 "2020-03-07T12:19:50Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)\
**Post date:** [8 March 2020 14:34 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/21 "2020-03-08T14:34:32Z")

</div>

os install  
and logged in a user  
and i am now in terminal window which talks about using root

do i just run this command as is or do i need to put the sudo in front?

---

<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:** [8 March 2020 14:42 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/22 "2020-03-08T14:42:13Z")

</div>

Do not put sudo in front of it.

The instructions don't mention sudo.

If you needed to use sudo the docs would tell you.

---

<div class="post-metadata">

**Author:** ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)\
**Post date:** [8 March 2020 14:45 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/23 "2020-03-08T14:45:44Z")

</div>

then why has this failed

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/4/64b959c9068ddddd823bfaa437e5ac0a0b4a67b5.png)

garrath

---

<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:** [8 March 2020 14:47 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/24 "2020-03-08T14:47:56Z")

</div>

That suggests you have run npm with sudo previously and it has screwed up permissions.  
Run the command it suggests:

```auto
sudo chown -R ........

```

Then rerun the script.

---

<div class="post-metadata">

**Author:** ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)\
**Post date:** [8 March 2020 14:57 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/25 "2020-03-08T14:57:43Z")

</div>

this is a new install  
nothing has been done other than  
installed zorin 15 core  
signed in  
run the software updated checker (found no updates)  
started terminal session  
then ran the bash command

this is the result  
"  
user@zorin15core:~$ bash \<(curl -sL [https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered](https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered))

This script will remove versions of Node.js prior to version 7.x, and Node-RED and  
if necessary replace them with Node.js 10.x LTS (dubnium) and the latest Node-RED from Npm.

It also moves any Node-RED nodes that are globally installed into your user  
~/.node-red/node\_modules directory, and adds them to your package.json, so that  
you can manage them with the palette manager.

It also tries to run 'npm rebuild' to refresh any extra nodes you have installed  
that may have a native binary component. While this normally works ok, you need  
to check that it succeeds for your combination of installed nodes.

To do all this it runs commands as root - please satisfy yourself that this will  
not damage your Pi, or otherwise compromise your configuration.  
If in doubt please backup your SD card first.

Are you really sure you want to do this ? [y/N] ? y

Would you like to install the Pi-specific nodes ? [y/N] ?

Running Node-RED update for user user at /home/user on zorin

[sudo] password for user:

This can take 20-30 minutes on the slower Pi versions - please wait.

Stop Node-RED ✔  
Remove old version of Node-RED ✔  
Remove old version of Node.js ✔  
Install Node.js LTS ✔ Node v12.16.1 Npm 6.14.2  
Clean npm cache ✔  
Install Node-RED core  
┌────────────────────────────────────────────────────────┐  
│ npm update check failed │  
│ Try running with sudo or get access │  
│ to the local update config store via │  
│ sudo chown -R USER:(id -gn $USER) /home/user/.config │  
└────────────────────────────────────────────────────────┘  
Install Node-RED core ✔ 1.0.4  
Any errors will be logged to /var/log/nodered-install.log  
┌────────────────────────────────────────────────────────┐  
│ npm update check failed │  
│ Try running with sudo or get access │  
│ to the local update config store via │  
│ sudo chown -R USER:(id -gn $USER) /home/user/.config │  
└────────────────────────────────────────────────────────┘  
Move global nodes to local -  
Install extra Pi nodes -  
Npm rebuild existing nodes -  
Add shortcut commands ✔  
Update systemd script ✔

All done.  
You can now start Node-RED with the command node-red-start  
or using the icon under Menu / Programming / Node-RED  
Then point your browser to localhost:1880 or http://{your\_pi\_ip-address}:1880

Started Sun 8 Mar 14:40:55 GMT 2020 - Finished Sun 8 Mar 14:42:07 GMT 2020

user@zorin15core:~ ^C user@zorin15core:~  
"

---

<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:** [8 March 2020 15:00 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/26 "2020-03-08T15:00:33Z")

</div>

Ok, so aside from the npm update message, the output ends with:

> [@gbond](#):
>
> All done.  
> You can now start Node-RED with the command node-red-start  
> or using the icon under Menu / Programming / Node-RED  
> Then point your browser to localhost:1880 or http://{your\_pi\_ip-address}:1880

Have you tried any of that?

---

<div class="post-metadata">

**Author:** ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)\
**Post date:** [8 March 2020 15:05 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/27 "2020-03-08T15:05:46Z")

</div>

yes its up and running  
but I am still left with the same issue I can't install my nodes

* * *

2020-03-08T15:04:07.984Z Install : node-red-contrib-smartthings 0.0.20

2020-03-08T15:04:08.046Z npm install --no-audit --no-update-notifier --save --save-prefix="~" --production node-red-contrib-smartthings@0.0.20  
2020-03-08T15:04:08.959Z [err] npm  
2020-03-08T15:04:08.960Z [err] ERR! code ENOENT  
2020-03-08T15:04:08.960Z [err] npm ERR! syscall spawn git  
2020-03-08T15:04:08.960Z [err] npm ERR! path git  
2020-03-08T15:04:08.960Z [err] npm ERR! errno ENOENT  
2020-03-08T15:04:08.960Z [err] npm  
2020-03-08T15:04:08.960Z [err] ERR! enoent Error while executing:  
2020-03-08T15:04:08.960Z [err] npm ERR!  
2020-03-08T15:04:08.960Z [err] enoent undefined ls-remote -h -t [https://github.com/otaviojr/smartthings-node.git](https://github.com/otaviojr/smartthings-node.git)  
2020-03-08T15:04:08.960Z [err] npm ERR! enoent  
2020-03-08T15:04:08.960Z [err]  
2020-03-08T15:04:08.960Z [err] npm ERR! enoent  
2020-03-08T15:04:08.960Z [err]  
2020-03-08T15:04:08.960Z [err] npm ERR! enoent spawn git ENOENT  
2020-03-08T15:04:08.960Z [err] npm  
2020-03-08T15:04:08.960Z [err] ERR! enoent This is related to npm not being able to find a file.  
2020-03-08T15:04:08.960Z [err] npm ERR!  
2020-03-08T15:04:08.961Z [err] enoent  
2020-03-08T15:04:08.967Z [err]  
2020-03-08T15:04:08.967Z [err] npm ERR! A complete log of this run can be found in:  
2020-03-08T15:04:08.967Z [err] npm  
2020-03-08T15:04:08.967Z [err] ERR! /home/user/.npm/\_logs/2020-03-08T15\_04\_08\_961Z-debug.log  
2020-03-08T15:04:08.970Z rc=1

---

<div class="post-metadata">

**Author:** ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)\
**Post date:** [8 March 2020 15:07 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/28 "2020-03-08T15:07:13Z")

</div>

and what are the error on a new install all about?

---

<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:** [8 March 2020 15:09 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/29 "2020-03-08T15:09:58Z")

</div>

This thread was about how to install Node-RED. If you have issues installing a particular node, that is a separate matter.

I don't know why you hit that particular warning about npm update - I have never seen it before. All I can suggest is you do what it says and run:

```auto
sudo chown -R USER:(id -gn $USER) /home/user/.config 

```

---

<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:** [8 March 2020 15:11 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/30 "2020-03-08T15:11:12Z")

</div>

Regarding the install error, is it only that particular module you can't install? Have you tried installing something else?

---

<div class="post-metadata">

**Author:** ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)\
**Post date:** [8 March 2020 15:15 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/31 "2020-03-08T15:15:52Z")

</div>

sorry i am stuggling to understand this is all node-red to me and setting it up  
I dont understand the sudo command, do I just run "sudo chown -R USER:(id -gn $USER) /home/user/.config" from the terminal screen  
or is it telling me to login as administrator somehow or is it saying run the original command with sudo in front off it (which is how I would read it)?

---

<div class="post-metadata">

**Author:** ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)\
**Post date:** [8 March 2020 15:17 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/32 "2020-03-08T15:17:54Z")

</div>

why is my setup any different than the test you did?

I am running it on a hyper-v virtual but I see no reason that should make an difference!

---

<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:** [8 March 2020 15:24 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/33 "2020-03-08T15:24:26Z")

</div>

Run the command exactly as written in a regular terminal.

```auto
sudo chown -R USER:(id -gn $USER) /home/user/.config

```

---

<div class="post-metadata">

**Author:** ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)\
**Post date:** [8 March 2020 15:29 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/34 "2020-03-08T15:29:26Z")

</div>

ok done

now what do i do (sorry)

---

<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:** [8 March 2020 15:36 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/35 "2020-03-08T15:36:48Z")

</div>

> [@gbond](#):
>
> now what do i do (sorry)

Running that command should have fixed up the issue with npm. It doesn't have any bearing on running Node-RED. As you've shown, you can already run node-red.

So its up to you what to do next.

I've had a quick look at the smartthings node you are trying to install. One of its dependencies requires the `git` command line tool to be installed. The error you are getting means you don't have `git` installed.

You can install `git` by running the following in a terminal exactly as written:

```auto
sudo apt-get install git

```

Once that has completed, try installing the smartthings node in Node-RED again.

---

<div class="post-metadata">

**Author:** ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)\
**Post date:** [8 March 2020 15:42 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/36 "2020-03-08T15:42:46Z")

</div>

R thank you so much  
that has fixed it !!

so sorry its been so difficult I dont know what git is or where it came from or how you found it

but it has now loaded and appears to be working

thank you so much

I do like the system but find the installation and updates very confusing

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [8 March 2020 17:23 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/37 "2020-03-08T17:23:09Z")

</div>

Nodes should not normally need git in order to install - the fact that this one does is an oddity and down to the way the author has decided to package his node. I'll ask the author to see what he says.

---

<div class="post-metadata">

**Author:** ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)\
**Post date:** [8 March 2020 19:03 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/38 "2020-03-08T19:03:16Z")

</div>

great let me know

---

<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:** [9 March 2020 22:05 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/39 "2020-03-09T22:05:59Z")

</div>

Split this topic on 9 March 2020 22:05 UTC

3 posts were split to a new topic: [How to include git in a Node-RED Docker Instance](https://discourse.nodered.org/t/how-to-include-git-in-a-node-red-docker-instance/22896)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [9 March 2020 22:34 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/40 "2020-03-09T22:34:11Z")

</div>

> [@gbond](#):
>
> node-red-contrib-smartthings

Issue raised here - [Loading dependency from github · Issue #27 · otaviojr/node-red-contrib-smartthings · GitHub](https://github.com/otaviojr/node-red-contrib-smartthings/issues/27)

[Previous page](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753.md?page=1)

[Next page](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753.md?page=3)
