-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NodeJS 18 not working on Ubuntu 18.04 #1392
Comments
Node.js 18 is compatible with Linux distributions based on glibc 2.28 or later, for example, Debian 10, RHEL 8, and Ubuntu 20.04. You can find more information in the release notes. |
Yes, I've read the release update. But the problem is NodeJS 18 has a release file over here for an OS you're telling me it doesn't support. A fix for this problem would be to build NodeJS 18 on Debian Stretch, RHEL 7, Ubuntu 16.04 (which is still under ESM), or 18.04 (which is still receiving maintenance updates and is still currently considered LTS, as detailed here). If that's not possible for some reason, then the documentation needs updating. Is glibc 2.28 a hard requirement for NodeJS 18, or is that simply a side effect of the build environment used? |
agreed @JesusPaz , you should at MINIMUM remove the dists from your repo that nodejs18 doesn't support
this is disingenuous, the majority of these will not work (xenial, stretch, buster, bionic) |
@JesusPaz it's been about a week - when can we receive an update or an ETA on this? |
If Node.js 18 doesn't work at all on older systems, then information stating otherwise should be removed or at least clarified. Right now, anyone who tries to install the Node.js package on an older OS will find that it's completely broken. |
@chrislea Hi there - sorry if I'm pinging the wrong person, but would you be able to give us an update on what the plans are here? |
Hi @cobalt2727. Sorry but I can't help here. I haven't worked at Nodesource in over three years and my access to any of the relevant build infrastructure that I'd need to see what's going on has long been revoked. I can tell you from memory that when things like this (making newer versions of node work on older systems) happened back when I was dealing with it, the problem was usually that V8 started using some C++ feature that required a fairly modern C++ compiler, which in turn required a more modern version of Again, I need to stress that I don't know if that's what's going on here. I'm not in the node universe anymore really and haven't been for some time. That's just a guess based on what I remember from ~ 4 years ago. |
@JesusPaz Good morning/afternoon/evening. This issue needs to be reopened. No PPAs, external repos, or source builds (besides the building of NodeJS itself) were used in the process of bringing you the screenshot above. NodeJS 18 itself does not require glibc 2.28 or later to function. Saying so directly conflicts with NodeJS's official documentation, which lists off required dependencies that are all available just from Ubuntu 18.04's apt repository. The decision to build NodeJS 18's binaries on newer environments needs to be fixed. As @Botspot and @theofficialgman pointed out above, it's resulting in critical installation failures with packages being built that are impossible to install on the intended system, as shown here. There are two solutions to this.
One way or another, this part of the README is currently inaccurate and must be fixed. |
Just got bit by this myself. It feels like the prebuilt Node v18 binaries should not be allowed to be installed on Ubuntu 18 since they simply won't run. |
@dominic-p Until they fix this, you can build NodeJS yourself by following https://github.com/nodejs/node/blob/v18.x/BUILDING.md#unix-and-macos with two exceptions: And then while setting up the build: This is a massive pain to update though given how long it takes to build on most hardware. |
Thanks for sharing that! I considered trying to build it myself, but I figured it was going to be a massive pain, and there's no way I was going to figure out the exceptions above on my own. For now, Node v16 is sufficient for my needs until I can get around to upgrading the host OS. I'm just kind of surprised that Nodesource is leaving this closed. This issue is definitely not resolved. |
Hi @JesusPaz, any updates? |
So current NodeJS LTS version will break on Ubuntu LTS 18.04. Is there any work around? |
@TranNgocKhoa you'll have to either do this, stick to NodeJS 16, or get on a newer OS (if possible with your setup). |
My server is down because I tried updating node and was unaware of the catastrophic failure resulting from installing node 18 on Ubuntu 18. Very sorry I updated node, now I need to go repair my server. Than ks! |
I've just managed to get Node 20 working on an Ubuntu 18 instance, by compiling my own version of sudo -i
# Start by installing Node 20:
curl -L https://raw.githubusercontent.com/tj/n/master/bin/n -o n
bash n 20
# Node 20 is now at /usr/local/bin/node, but glibc 2.28 is missing:
# node: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
# /usr/local/bin/node: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /usr/local/bin/node)
# Build and install glibc 2.28:
apt install -y gawk
cd ~
wget -c https://ftp.gnu.org/gnu/glibc/glibc-2.28.tar.gz
tar -zxf glibc-2.28.tar.gz
cd glibc-2.28
../configure --prefix=/opt/glibc-2.28
make -j 4 # Use all 4 Jetson Nano cores for much faster building
make install
cd ..
rm -fr glibc-2.28 glibc-2.28.tar.gz
# Patch the installed Node 20 to work with /opt/glibc-2.28 instead:
apt install -y patchelf
patchelf --set-interpreter /opt/glibc-2.28/lib/ld-linux-aarch64.so.1 --set-rpath /opt/glibc-2.28/lib/:/lib/aarch64-linux-gnu/:/usr/lib/aarch64-linux-gnu/ /usr/local/bin/node
# Et voilà:
node --version
v20.8.0 |
Hi @lehni shout outs to you for this instructions it looks pretty easy. |
@riosje I can't see any downside so far, but will keep an eye out and report back if I see issues with this approach. I don't really have time to write the wiki article, but feel free to use the above and add it there. |
@lehni this works perfectly! Just as a note for others, on x64 Ubuntu, you'll have to replace |
I slightly expanded the solution from @lehni and @ShotSkydiver (installing the necessary dependencies and fixing go to the directory for configurate), and here is the complete solution that worked for me: sudo -i
# Start by installing Node 20:
sudo apt-get install python3 g++ make python3-pip gcc bison
curl -L https://raw.githubusercontent.com/tj/n/master/bin/n -o n
bash n 20
# Node 20 is now at /usr/local/bin/node, but glibc 2.28 is missing:
# node: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
# /usr/local/bin/node: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /usr/local/bin/node)
# Build and install glibc 2.28:
apt install -y gawk
cd ~
wget -c https://ftp.gnu.org/gnu/glibc/glibc-2.28.tar.gz
tar -zxf glibc-2.28.tar.gz
cd glibc-2.28
pwd
mkdir glibc-build
cd glibc-build
../configure --prefix=/opt/glibc-2.28
make -j 4 # Use all 4 Jetson Nano cores for much faster building
make install
cd ..
rm -fr glibc-2.28 glibc-2.28.tar.gz
# Patch the installed Node 20 to work with /opt/glibc-2.28 instead:
apt install -y patchelf
patchelf --set-interpreter /opt/glibc-2.28/lib/ld-linux-x86-64.so.2 --set-rpath /opt/glibc-2.28/lib/:/lib/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/ /usr/local/bin/node
# Et voilà:
node --version
v20.9.0 |
@lehni Thanks a million! Finally resolved my issue in installing NodeJS 20 on Ubuntu 18 ❤️ |
@4KDA when i do "make install", an error appears. Maybe, you know how to fix it? i can't find make[2]: *** No rule to make target '/root/glibc-2.28/glibc-build/mathvec/libmvec.so.1', needed by '/opt/glibc-2.28/lib/libm.so'. Stop. |
@4KDA Thank you! That worked perfectly 🙏 |
@lehni @4KDA compile error when run 'make -j 4',the error output is as follows: /tmp/glibc-2.28/nss/nss_files/files-key.c:101: undefined reference to `xdecrypt' how to fix it? My building env is ubuntu 18.04. |
Hi,i find another way ,you can try it,come from this article https://blog.csdn.net/Youning_Yim/article/details/129343107
after finish all steps ,you can install high version node on ubuntu 18.04 |
executing patchelf --set-interpreter /opt/glibc-2.28/lib/ld-linux-x86-64.so.2 I got missing filename |
actually at root running: patchelf --set-interpreter /opt/glibc-2.28/lib/ld-linux-x86-64.so.2 --set-rpath /opt/glibc-2.28/lib/:/lib/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/ /usr/local/bin/node I got stat: No such file or directory |
seems now in glibc-2.28 lib folder is been renamed or changed |
@4KDA I got an error at very last command in patch the new build for the library: patchelf --set-interpreter /opt/glibc-2.28/lib/ld-linux-x86-64.so.2 --set-rpath /opt/glibc-2.28/lib/:/lib/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/ /usr/local/bin/node got stat: No such file or directory I guess it refer to /usr/local/bin/node P.S I am at my root Ubuntu(I see root@Legion~#) |
If you need to build a newer glibc, you may need to use a newer gcc, than the version available in the distro. For example, glibc 2.34 requires gcc 6, while Ubuntu 16 contains gcc 4. And upgrading the distro may not be easy for an exotic SBC hardware. As chrislea wrote, it's not easy to upgrade the interconnected gcc, libstc++ and glibc. Luckily, the team "PPA for Ubuntu Toolchain Uploads" prepares packages with newer gcc versions. 4KDA's instructions work great for newer glibcs too, once you install a newer gcc.
The rest of the instructions will work as-is. |
To have it working on a Jetson Nano machine, I replaced the last
|
Looks like NodeJS 18 wasn't built properly for Ubuntu Bionic - it only has glibc 2.27...
(not my screenshot, but I can contact the uploader for any tests needed)
The text was updated successfully, but these errors were encountered: