# Help Wanted - testing updated install script

**URL:** https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685
**Category:** General
**Created:** [15 May 2021 14:57 UTC](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685 "2021-05-15T14:57:00Z")
**Posts on this page:** 20
**Page:** 3

<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: [22 May 2021 08:39 UTC](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685/41 "2021-05-22T08:39:11Z")

</div>

Is the script supposed to time out after about 30 seconds on the pi specific nodes question (just when you are trying to remember what they are and check whether you want them)? It appears to default to no.

A corollary question is, if this is a run of the script over an existing install should it even ask the question?

---

<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: [22 May 2021 10:34 UTC](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685/42 "2021-05-22T10:34:21Z")

</div>

Correct. If you say yes it will install latest versions of pi nodes. If you say no it will leave whatever is there. So generally would be ok to leave it default to no unless a new install.

We don’t know if you have installed them before.

---

<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: [22 May 2021 12:04 UTC](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685/43 "2021-05-22T12:04:37Z")

</div>

> [@dceejay](#):
>
> Correct

Do you mean it _is_ supposed to timeout after 30 seconds and drop through?

---

<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: [22 May 2021 12:12 UTC](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685/44 "2021-05-22T12:12:43Z")

</div>

Yes - Still correct

---

<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: [22 May 2021 12:26 UTC](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685/45 "2021-05-22T12:26:29Z")

</div>

OK, has it always done that?

---

<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: [22 May 2021 12:30 UTC](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685/46 "2021-05-22T12:30:27Z")

</div>

Yes it has

---

<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: [22 May 2021 12:32 UTC](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685/47 "2021-05-22T12:32:43Z")

</div>

OK, thanks. I should have tried it myself to find out, sorry.

---

<div class="post-metadata">

### Author: ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)
#### Post date: [23 May 2021 02:09 UTC](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685/48 "2021-05-23T02:09:32Z")

</div>

I was pretty certain it was the right file - i transferred it to my PC using WINSCP and then attached.

Let em grab it again to confirm i did not throw you a red herring

Craig

---

<div class="post-metadata">

### Author: ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)
#### Post date: [23 May 2021 02:16 UTC](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685/49 "2021-05-23T02:16:44Z")

</div>

Ran the latest test again - here is the result

pi@HA-NodeJS-Dev:~/.node-red$

This script checks the version of node.js installed is 12 or greater. It will try to  
install node 14 if none is found. It can optionally install node 12 LTS or 14 LTS for you.

If necessary it will then remove the old core of Node-RED, before then installing the latest  
version. You can also optionally specify the version required.

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.

See the optional parameters by re-running this command with --help

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

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

Running Node-RED update for user pi at /home/pi on ubuntu

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

Stop Node-RED ✔  
Remove old version of Node-RED ✔  
Node option not specified : --node12 or --node14  
Leave existing Node.js : v14.17.0 Npm 6.14.13  
Clean npm cache -  
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it! existing nodes  
Install Node-RED core ✔  
Move global nodes to local -  
Leave existing nodes -  
Install extra Pi nodes -  
Add shortcut commands ✔  
Update systemd script ✔/nodered-install.log

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 23 May 12:14:21 AEST 2021 - Finished Sun 23 May 12:14:47 AEST 2021

pi@HA-NodeJS-Dev:~/.node-red$ node-red-start

Start Node-RED

Once Node-RED has started, point a browser at [http://172.16.100.36:1880](http://172.16.100.36:1880)  
On Pi Node-RED works better with the Firefox or Chrome browser

Use node-red-stop to stop Node-RED  
Use node-red-start to start Node-RED again  
Use node-red-log to view the recent log output  
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot  
Use sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to [http://flows.nodered.org](http://flows.nodered.org)

Starting as a systemd service.  
Error loading settings file: /home/pi/.node-red/settings.js  
Error: Could not locate the bindings file. Tried:  
→ /home/pi/.node-red/node\_modules/node-expat/build/node\_expat.node  
→ /home/pi/.node-red/node\_modules/node-expat/build/Debug/node\_expat.node  
→ /home/pi/.node-red/node\_modules/node-expat/build/Release/node\_expat.node  
→ /home/pi/.node-red/node\_modules/node-expat/out/Debug/node\_expat.node  
→ /home/pi/.node-red/node\_modules/node-expat/Debug/node\_expat.node  
→ /home/pi/.node-red/node\_modules/node-expat/out/Release/node\_expat.node  
→ /home/pi/.node-red/node\_modules/node-expat/Release/node\_expat.node  
→ /home/pi/.node-red/node\_modules/node-expat/build/default/node\_expat.node  
→ /home/pi/.node-red/node\_modules/node-expat/compiled/14.17.0/linux/x64/node\_expat.node  
at bindings (/home/pi/.node-red/node\_modules/bindings/bindings.js:93:9)  
at Object. (/home/pi/.node-red/node\_modules/node-expat/lib/node-expat.js:4:32)  
at Module.\_compile (internal/modules/cjs/loader.js:1068:30)  
at Object.Module.\_extensions..js (internal/modules/cjs/loader.js:1097:10)  
at Module.load (internal/modules/cjs/loader.js:933:32)  
at Function.Module.\_load (internal/modules/cjs/loader.js:774:14)  
at Module.require (internal/modules/cjs/loader.js:957:19)  
at require (internal/modules/cjs/helpers.js:88:18)  
at Object. (/home/pi/.node-red/node\_modules/xml2json/lib/xml2json.js:1:13)  
at Module.\_compile (internal/modules/cjs/loader.js:1068:30) {  
tries: [  
'/home/pi/.node-red/node\_modules/node-expat/build/node\_expat.node',  
'/home/pi/.node-red/node\_modules/node-expat/build/Debug/node\_expat.node',  
'/home/pi/.node-red/node\_modules/node-expat/build/Release/node\_expat.node',  
'/home/pi/.node-red/node\_modules/node-expat/out/Debug/node\_expat.node',  
'/home/pi/.node-red/node\_modules/node-expat/Debug/node\_expat.node',  
'/home/pi/.node-red/node\_modules/node-expat/out/Release/node\_expat.node',  
'/home/pi/.node-red/node\_modules/node-expat/Release/node\_expat.node',  
'/home/pi/.node-red/node\_modules/node-expat/build/default/node\_expat.node',  
'/home/pi/.node-red/node\_modules/node-expat/compiled/14.17.0/linux/x64/node\_expat.node'  
]  
}

Craig

---

<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: [23 May 2021 08:07 UTC](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685/50 "2021-05-23T08:07:58Z")

</div>

Hi Dave, FYI, Linux under Windows WSL worked a treat

```auto
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/v2/deb/update-nodejs-and-nodered) --node16 --update-nodes

```

Windows10 → WSL → Ubuntu 20.04.1 LTS

It uninstalled node v14 & installed v16 & updated node-red without a hitch.

Absolutely perfect 👍

---

<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: [23 May 2021 12:22 UTC](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685/51 "2021-05-23T12:22:01Z")

</div>

Hi Dave, FYI

Just tried the default install on an alpine image under WSL

I know this script is for PI / Ubuntu, but it is very nearly possible to use on other distros.

If this is of interest...

this is the result of running the script on a fresh alpine installation...

```auto
 Install Node.js 14 LTS ✘ Bad install Node.js or Npm missing - Exit

```

logifle...

```auto
## Installing the NodeSource Node.js 14.x repo...

## Populating apt-get cache...

+ apt-get update
bash: line 1: apt-get: command not found
Error executing command, exiting
sudo: apt: command not found

```

Obviously, the issue is `apt` is not present. Alpine uses `apk` instead of `apt`.

But after manually installing nodejs and npm, the script ran & installed a working node-red (minus the systemd service)...

I have modified a local copy of the script that does the following...

- if (`node` or `npm`) AND `apt` is missing
  - exit the script indicating to the user they will need to "manually install node-js + npm"

- if `systemd` is missing
  - skip shortcut setup
  - skip service setup

---

<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: [23 May 2021 15:06 UTC](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685/52 "2021-05-23T15:06:38Z")

</div>

@Steve-Mcl - A PR would be great !

---

<div class="post-metadata">

### Author: ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)
#### Post date: [24 May 2021 01:21 UTC](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685/53 "2021-05-24T01:21:28Z")

</div>

Dave,

Ok i manually edited the package file and removed the XML2JSON package

I then commented it out in the settings.js

I also used NPM to uninstall node-expat

And the script now runs through fine

Craig

---

<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: [24 May 2021 13:24 UTC](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685/54 "2021-05-24T13:24:24Z")

</div>

Hi Dave,

> [@dceejay](#):
>
> A PR would be great !

No bother...

PR raised: [V2 - allow script to continue even if apt or systemd is missing by Steve-Mcl · Pull Request #14 · node-red/linux-installers · GitHub](https://github.com/node-red/linux-installers/pull/14)

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [25 May 2021 11:17 UTC](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685/55 "2021-05-25T11:17:49Z")

</div>

Just for fun, I installed Debian to run under WSL on my Win10 setup

For some reason, curl wasn't installed by default but after installing that the install seemed to go fine

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/3/e3a27280efe60a5dc8d7e6ba61180941bcc72299.png)

but when I cd..d into .node-red there was no settings.js file - I ran node-red anyway and it worked (and warned me that port was in use - which it was )

I exited and settings.js now existed so I just edited it to change to port 11880 and all works fine 🙂

---

<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: [25 May 2021 11:35 UTC](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685/56 "2021-05-25T11:35:23Z")

</div>

> [@cymplecy](#):
>
> but when I cd..d into .node-red there was no settings.js file - I ran node-red anyway and it worked (and warned me that port was in use - which it was )

Files in `~/.node-red` are not created until first run Simon.

Glad it worked anyhow - phew 🙂

PS: I didn't state (for brevity) on my previous posts about curl being missing when installing node-red on the alpine image under WSL - I also had to install `curl`. In fact, I also had to install `sudo` and setup sudo groups etc - but I thought it was out of scope so didn't mention it.

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [25 May 2021 11:40 UTC](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685/57 "2021-05-25T11:40:07Z")

</div>

> [@Steve-Mcl](#):
>
> PS: I didn't state (for brevity) on my previous posts about curl being missing

Aah - I see you like your little secrets 🙂

> [@Steve-Mcl](#):
>
> Files in `~/.node-red` are not created until first run Simon.

I hadn't realised that as I'd normally install NR onto a new Pi and just run it.

When I add extra instances on a machine with NR on it - I use @TotallyInformation alternate installer and that does create the settings.js file so I can edit port number before 1st launch

Is there a reason that main installer doesn't create the settings.js file before 1st run?

---

<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: [25 May 2021 11:42 UTC](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685/58 "2021-05-25T11:42:28Z")

</div>

> [@cymplecy](#):
>
> Is there a reason that main installer doesn't create the settings.js file before 1st run?

You'll have to ask Nick or Dave but I suspect it is because you may not want to have your flows in `~/.node-red` (I don't) so the files would be created for no reason.

> [@cymplecy](#):
>
> I see you like your little secrets

Just keepin' it brief 😛

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [25 May 2021 11:46 UTC](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685/59 "2021-05-25T11:46:57Z")

</div>

> [@Steve-Mcl](#):
>
> Just keepin' it brief

Well you wasted 2 days of my time as it didn't work so I removed my existing WSL setup and re-installed it 🙂

Your off my Christmas card list! 🙂

---

<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: [25 May 2021 11:54 UTC](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685/60 "2021-05-25T11:54:55Z")

</div>

> [@cymplecy](#):
>
> > [@Steve-Mcl](#):
> >
> > Just keepin' it brief
> 
> Well you wasted 2 days of my time as it didn't work so I removed my existing WSL setup and re-installed it 🙂

haha - sowwy Simon.

In my defence, I figured since you need curl to actually download the remote script in the first place and the terminal tells you its not found, it would be obvious 😛

Its not my fault you got the sledgehammer out to crack the nut 🤣 🤣

Put me back on the good list immediately 😇

[Previous page](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685.md?page=2)

[Next page](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685.md?page=4)
