If you are using Ubuntu the first yellow box in the docs is where you need to start - https://nodered.org/docs/getting-started/local
aka use the Pi/Debian/Ubuntu install script.
Or if you want to tidy up first
thanks
then i get this!
"user@zorin:~ sudo npm install -g --unsafe-perm node-red
[sudo] password for user:
/usr/bin/env: ānodeā: No such file or directory
user@zorin:~"
I really need it to run as a service is it possible
"
This can take 20-30 minutes on the slower Pi versions - please wait.
Stop Node-RED
Remove old version of Node-RED
Using NVM to manage Node.js + please run nvm use lts/* before running ./node-reds
NOTE: Using nvm is NOT RECOMMENDED. Node-RED will not run as a service unde nvm.Install Node-RED core
Update Node.js LTS Node v12.16.1 Npm 6.13.4
Clean npm cache
Install Node-RED core
Move global nodes to local -
Install extra Pi nodes
Npm rebuild existing nodes -
Add shortcut commands
Update systemd script /nodered-install.log
"
OK, you realise that is what Dave's script is don't you? Why not take a look at it so that you understand what it is doing. It is just issuing the commands in order that you would have to do by hand in a terminal. It also checks things that you would otherwise have to work out for yourself.
You do need some basic skills here if you want to set up a server to run home automation. In this case, some basic administration skills.
On any IT system, it is common to have at least 2 different logins (2 user identities). One for administrative stuff (installing software, rebooting, adding new users, etc) and one for user stuff (that cannot do the admin stuff).
It is much preferred to run software services as a "user" rather than as an "administrator" because that is a lot more secure. So we recommend running Node-RED with user credentials. On a Raspberry Pi with the default OS installed, that is simple because it is designed to be simple. There are 2 users. "pi" and "root". Root is the default admin super-user on Linux. It has special powers and you really don't want to use it unless you have to. So Node-RED is run under the "pi" user typically on a Raspberry Pi.
However, the standard install for Node-RED does require admin access because it is installed for any user to use (a so-called "global" installation). In order to do that, we temporarily give admin rights to the normal user. That uses a special command called sudo. Confusingly, when using sudo, you give the users password not the root password - that's because you have to give a user permission to use sudo and only root can do that.
Now, if you are not using a Pi or not using the default Rasbian OS (which is based on Debian). You may need to do some more things yourself. Typical Linux installations ask you to set up a standard user account when you install the OS. This becomes the equivalent of the "pi" user. However, it may not have the rights that the pi user gets since most OS installations prefer security over convenience. So you may need to give your user sudo rights and may need to add it to some additional user groups so that it has access to hardware such as USB ports and Bluetooth for example. You will need to read up on the help for your OS to do that.
I've tried to gloss over a load of detail which isn't important to get you going but hopefully that makes more sense as to why there are two different identities and how/when they are used.
Well, mainly it is just different. It also uses similar security concepts but implements them somewhat differently.
yes thanks that is little clearer i'm used to doing everthing as an administrator & dont tend to bother with users so think that is why this seems back to front
not sure I have really found where you hadle the security in linux (every thing i have seen appear to over complicate it)
I'm happy to stick with the raspberry pi way off doing (if only I know how)
Yes - it will ask for the admin (sudo) password once while it does the install - it will also install the the service for you (but not enable it).
Once installed if you run node-red-start once it will start Node-RED so you can test - but also print out the command you need to type to enable the service to start at boot time. Do that and the next time you boot Node-RED should be automatically running.