Newbie trying to install Pi Gateway. Clean install but Nodejs fails [solved]

Started by Scott-R, April 27, 2019, 01:18:29 PM

Scott-R

Hi Everyone,

Sorry but I'm completely new to all this and have spent hours trying to get the gateway socket to work. It always just says "Waiting for socket connection..."

I pasted my install log below. It's a fresh install of Raspbian and I believe I followed Felix's instructions properly. I have a Moteino USB connected to a RPi3 and I've edited the configuration file so it has my email address as well as the USB port for the Moteino. Not sure if that even matters for a socket connection issue.

I did notice the Nodejs install seems to fail every time I do the install. I have tried to figure this all out but maybe I've jumped into the deep end too soon. I'm a total Newbie.

Any help would be appreciated. I would love to get this working :)

Scott

--2019-04-26 21:57:37--  https://raw.githubusercontent.com/audstanley/NodeJs-Raspberry-Pi/master/Install-Node.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.0.133, 151.101.64.133, 151.101.128.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.0.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1689 (1.6K) [text/plain]
Saving to: 'STDOUT'

-                   100%[===================>]   1.65K  --.-KB/s    in 0s      

2019-04-26 21:57:37 (45.0 MB/s) - written to stdout [1689/1689]

--2019-04-26 21:57:38--  https://nodejs.org/dist/latest-v10.x/node-v11.14.0-linux-armv7l.tar.gz
Resolving nodejs.org (nodejs.org)... 104.20.23.46, 104.20.22.46, 2606:4700:10::6814:162e, ...
Connecting to nodejs.org (nodejs.org)|104.20.23.46|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2019-04-26 21:57:38 ERROR 404: Not Found.

tar (child): node-v11.14.0-linux-armv7l.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
rm: cannot remove 'node-v11.14.0-linux-armv7l.tar.gz': No such file or directory
mv: cannot stat '/root/tempNode/node-v11.14.0-linux-armv7l/': No such file or directory
update-alternatives: error: alternative path /opt/nodejs/bin/node doesn't exist
update-alternatives: error: alternative path /opt/nodejs/bin/npm doesn't exist
rm: cannot remove 'node-install': No such file or directory
--2019-04-26 21:57:38--  https://raw.githubusercontent.com/audstanley/NodeJs-Raspberry-Pi/master/node-install
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.0.133, 151.101.64.133, 151.101.128.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.0.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 10841 (11K) [text/plain]
Saving to: 'node-install'

node-install        100%[===================>]  10.59K  --.-KB/s    in 0.03s   

2019-04-26 21:57:40 (317 KB/s) - 'node-install' saved [10841/10841]

Felix

It's because this package is not there any longer: https://nodejs.org/dist/latest-v10.x/node-v11.14.0-linux-armv7l.tar.gz

A quick look reveals  that some changes were made to the install script by the author and there's already an issue open for it and thankfully a possible fix, but it was not merged yet.

If they fail to merge I may fork it and merge the fix myself but i'd like to avoid having to fork everything.


Felix

Nevermind, I just updated my script install to point to the fixed fork who submitted the fix. Until the original author merges we can use that one.
Please try running setup again, nodejs should install now.

Scott-R

Hi Felix. I tried again just now. I installed a fresh, new Raspbian Image and ran through the steps again. Same result. The nodejs still fails. Here is the install log again. I'll try to figure out which branch has the fix you're referring to and get it installed.

--2019-04-28 13:57:27--  https://raw.githubusercontent.com/timmalich/NodeJs-Raspberry-Pi/master/Install-Node.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.0.133, 151.101.64.133, 151.101.128.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.0.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1689 (1.6K) [text/plain]
Saving to: 'STDOUT'

-                   100%[===================>]   1.65K  --.-KB/s    in 0s      

2019-04-28 13:57:27 (46.0 MB/s) - written to stdout [1689/1689]

--2019-04-28 13:57:28--  https://nodejs.org/dist/latest-v10.x/node-v11.14.0-linux-armv7l.tar.gz
Resolving nodejs.org (nodejs.org)... 104.20.22.46, 104.20.23.46, 2606:4700:10::6814:172e, ...
Connecting to nodejs.org (nodejs.org)|104.20.22.46|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2019-04-28 13:57:28 ERROR 404: Not Found.

tar (child): node-v11.14.0-linux-armv7l.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
rm: cannot remove 'node-v11.14.0-linux-armv7l.tar.gz': No such file or directory
mv: cannot stat '/root/tempNode/node-v11.14.0-linux-armv7l/': No such file or directory
update-alternatives: error: alternative path /opt/nodejs/bin/node doesn't exist
update-alternatives: error: alternative path /opt/nodejs/bin/npm doesn't exist
rm: cannot remove 'node-install': No such file or directory
--2019-04-28 13:57:29--  https://raw.githubusercontent.com/audstanley/NodeJs-Raspberry-Pi/master/node-install
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.0.133, 151.101.64.133, 151.101.128.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.0.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 10841 (11K) [text/plain]
Saving to: 'node-install'

node-install        100%[===================>]  10.59K  --.-KB/s    in 0.02s   

2019-04-28 13:57:29 (460 KB/s) - 'node-install' saved [10841/10841]

Scott-R

Hi Felix,

Ok I managed to get NodeJS installed by following a guide I found online. However I still get the "Waiting for socket connection..." in both Safari and Chrome browsers when I go to https://raspberrypi

I checked the gateway log file and here is what I'm seeing. Any idea where I've gone wrong?

Scott

Felix

Ok, I made another update. Sorry but I have no way to test it right this moment, so please try again.
PS If it fails for any reason, please don't post the whole install log, only post what is relevant, the errors.

Scott-R

Thank you Felix. Sorry for posting the whole log. I will note this in the future to only post the error portion.

Whatever you changed, it is now working :)

I finally get to play with my Moteinos now I think!

Scott