install-node.sh fails on pi zero
Closed this issue · 3 comments
Thank you for this amazing app and playbook.
So I got a new pi zero today and I am having this error with the install-node.sh script.
The scripts tries to download https://nodejs.org/dist/latest-dubnium/node-v10.20.0-linux-armv6l.tar.gz
which does not exist on the remote server - https://nodejs.org/dist/latest-dubnium/ instead I am seeing https://nodejs.org/dist/latest-dubnium/node-v10.20.1-linux-armv6l.tar.gz on the remote server.
I'm seeing that the LTS version resolves to VERSION=v10.20.0.
In the interim, since my regex foo is 0, I have hardcoded VERSION=v10.20.1 to get this working. But it would be nice to fix this.
pi@officeroom:~ $ bash -x install-node.sh
++ uname -a
++ egrep 'armv[0-9]+l' -o
+ PI_ARM_VERSION=armv6l
++ egrep '{"version":"v([0-9]+\.?){3}"[^{]*"linux-armv6l[^}]*lts":"[^"]+"' -o
++ head -n 1
++ curl https://nodejs.org/dist/index.json
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
92 168k 92 156k 0 0 119k 0 0:00:01 0:00:01 --:--:-- 119k
curl: (23) Failed writing body (3997 != 4229)
+ NODE_VERSION='"version":"v10.20.0","date":"2020-03-24","files":["aix-ppc64","headers","linux-arm64","linux-armv6l","linux-armv7l","linux-ppc64le","linux-s390x","linux-x64","osx-x64-pkg","osx-x64-tar","src","sunos-x64","win-x64-7z","win-x64-exe","win-x64-msi","win-x64-zip","win-x86-7z","win-x86-exe","win-x86-msi","win-x86-zip"],"npm":"6.14.4","v8":"6.8.275.32","uv":"1.34.2","zlib":"1.2.11","openssl":"1.1.1e","modules":"64","lts":"Dubnium"'
++ egrep 'v([0-9]+\.?){3}' -o
++ echo '"version":"v10.20.0","date":"2020-03-24","files":["aix-ppc64","headers","linux-arm64","linux-armv6l","linux-armv7l","linux-ppc64le","linux-s390x","linux-x64","osx-x64-pkg","osx-x64-tar","src","sunos-x64","win-x64-7z","win-x64-exe","win-x64-msi","win-x64-zip","win-x86-7z","win-x86-exe","win-x86-msi","win-x86-zip"],"npm":"6.14.4","v8":"6.8.275.32","uv":"1.34.2","zlib":"1.2.11","openssl":"1.1.1e","modules":"64","lts":"Dubnium"'
+ VERSION=v10.20.0
++ egrep '"[^"]+"$' -o
++ egrep '[a-zA-Z]+' -o
++ tr '[:upper:]' '[:lower:]'
++ echo '"version":"v10.20.0","date":"2020-03-24","files":["aix-ppc64","headers","linux-arm64","linux-armv6l","linux-armv7l","linux-ppc64le","linux-s390x","linux-x64","osx-x64-pkg","osx-x64-tar","src","sunos-x64","win-x64-7z","win-x64-exe","win-x64-msi","win-x64-zip","win-x86-7z","win-x86-exe","win-x86-msi","win-x86-zip"],"npm":"6.14.4","v8":"6.8.275.32","uv":"1.34.2","zlib":"1.2.11","openssl":"1.1.1e","modules":"64","lts":"Dubnium"'
+ LTS_VERSION=dubnium
+ cd /home/pi/
+ mkdir temp
mkdir: cannot create directory ‘temp’: File exists
+ wget https://nodejs.org/dist/latest-dubnium/node-v10.20.0-linux-armv6l.tar.gz
--2020-04-16 15:46:43-- https://nodejs.org/dist/latest-dubnium/node-v10.20.0-linux-armv6l.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
2020-04-16 15:46:43 ERROR 404: Not Found.
+ tar -xzf node-v10.20.0-linux-armv6l.tar.gz
tar (child): node-v10.20.0-linux-armv6l.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
+ sudo rm node-v10.20.0-linux-armv6l.tar.gz
rm: cannot remove 'node-v10.20.0-linux-armv6l.tar.gz': No such file or directory
+ sudo rm -rf /opt/nodejs
+ sudo mv node-v10.20.0-linux-armv6l /opt/nodejs/
mv: cannot stat 'node-v10.20.0-linux-armv6l': No such file or directory
+ sudo unlink /usr/bin/node
+ sudo unlink /usr/sbin/node
+ sudo unlink /sbin/node
+ sudo unlink /usr/local/bin/node
+ sudo unlink /usr/bin/npm
+ sudo unlink /usr/sbin/npm
+ sudo unlink /sbin/npm
+ sudo unlink /usr/local/bin/npm
+ sudo ln -s /opt/nodejs/bin/node /usr/bin/node
+ sudo ln -s /opt/nodejs/bin/node /usr/sbin/node
+ sudo ln -s /opt/nodejs/bin/node /sbin/node
+ sudo ln -s /opt/nodejs/bin/node /usr/local/bin/node
+ sudo ln -s /opt/nodejs/bin/npm /usr/bin/npm
+ sudo ln -s /opt/nodejs/bin/npm /usr/sbin/npm
+ sudo ln -s /opt/nodejs/bin/npm /sbin/npm
+ sudo ln -s /opt/nodejs/bin/npm /usr/local/bin/npm
@sdesalas just updated his installer script for lts an hour ago, maybe that fixes the issue? You will need to delete the file from your Pis where it was already downloaded to get the new version.
As per the other issue on this topic, there is something wrong upstream: nodejs/node#32914. I'm watching that issue and hoping that it'll be resolved soon.
The issue is now fixed on both ends and the script should work again!