World!
I'm following a step by step tutorial on how to install React.Js on Linux Mint. If you wish, you can check out the tutorial at this link.
When I reach the step:
sudo npm install -g create-react-app
I get the following message from the terminal:
node: /lib/x86_64-linux-gnu/libc.so.6: versionGLIBC_2.28' not found (required by node)
`
Please, how can I find my ideal version of Node.Js that meets my needs (Node.Js 10 or higher) and how to resolve this message?
Some details about my OS:
Linux Mint 19.3 Cinnamon;
4.4.8 Cinnamon version;
5.4.0-135-generic Kernel.
Also, I'm having troubles for updating my OS but this is another topic and I'm just a curious newbie.
(fail) With apt-get
`
$ sudo apt-get install -y nodejs
Lendo listas de pacotes... Pronto
Construindo árvore de dependências
Lendo informação de estado... Pronto
nodejs is already the newest version (19.3.0-deb-1nodesource1).
0 pacotes atualizados, 0 pacotes novos instalados, 0 a serem removidos e 0 não atualizados.
$ node -v
node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
$ npm -v
node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
2. (fail) With nvm because my machine don't found 'nvm' deb name. 3. (fail) curl -fsSL https://deb.nodesource.com/setup_19.x | sudo -E bash - &&
sudo apt-get install -y nodejs`
Related
i got error when running npm, i've allready try to reinstall with
sudo apt-get remove nodejs npm -y && sudo apt-get install nodejs npm -y
this problem still exist
/usr/bin/node: 1: ELF: not found
/usr/bin/node: 2: : not found
/usr/bin/node: 4: Syntax error: Unterminated quoted string
im using Ubuntu WSL
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
Linux localhost 4.4.0-19041-Microsoft #1237-Microsoft Sat Sep 11 14:32:00 PST 2021 x86_64 x86_64 x86_64 GNU/Linux
npm -v command
npm -v
-bash: /usr/bin/node: cannot execute binary file: Exec format error
I could not get the solution to work, which was given here.
A different solution propossed from the same source which itself linked to here worked for me:
I first removed node and npm completly (To be precise all packages with the name in it, but I am not sure this is necessary). Then I used the give install command:
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - &&\
sudo apt-get install -y nodejs
This is for Ubuntu and node version 18, but you can find other operating systems and versions as well (look here).
I hope this helps someone.
This was an issue for me on Windows 10, using WSL2 and Ubuntu 22.04 LTS. The other solutions in this post did not help, and I was unwilling to downgrade to Ubuntu 20. Instead, I managed to fix it by removing all node-related packages with apt and then installing node via nvm as per this guide by Microsoft.
So to remove the packages:
sudo apt-get remove --purge nodejs npm
Then install nvm...
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
Restart the terminal. Then, make sure nvm is installed:
nvm --version
Finally, use nvm to install the latest version of node and npm:
nvm install node
Check to make sure node and npm are installed:
node --version
npm --version
Hope this helps!
i found same problem in github
https://github.com/microsoft/WSL/issues/8151
then i fix this problem with
wget https://gist.githubusercontent.com/lexavey/155a95d803224d7c0af7e225d0d82396/raw/3b4c103e4c3ff702674f96dd12cc412e9c8766ad/fixexec.py
sudo python3 ./fixexec.py $(realpath $(command -v node))
node -v
hope help other with same problem
Seems like an issue with WSL Ubuntu 22 Jammy and 8.5.1 package.
You may have luck installing a different package version, but I had issues with this.
Installed WSL Ubuntu 20 with 6.14.4, issue was gone.
node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
Above is the error I get when running npm install on ubuntu. I have node version 16.13.2 and ubuntu is version 18.04.
I tried adding following to package json but it did not work.
{
"engines": {
"node": ">= 16.13.2"
},
I also tried the following on ubunutu command line
sudo apt-get update
sudo apt-get install libc6
but, it did not work. It says I have the latest version already that is, 2.27-3ubuntu1.5 but the error mentions 2.28 is required. Cannot find how to update.
Maybe you are using latest version of node (18.0.0) . It created same error for me .
Use node js stable release or the version you are sure that will work.you can use n to install various nodejs verson.
you can install n using npm sudo npm i -g n after that run
sudo n stable or sudo n <node version you needed>
I have tried various methods by which I can install the latest version of nodejs on my operating system but was unsuccessful.
In the end it always ends up installing
version v.4.2.6
When I run the commands below, it always shows an error as shared in the screenshots of my terminal.
Current release:
sudo apt-get install curl python-software-properties
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
or LTS release:
sudo apt-get install curl python-software-properties
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
// throws error
Version:
Trying to execute node 11 script:
o/p of the above script:
Please guide me how can it be fixed. I have followed some of the other stackoverflow links but couldn't make it.
Thanks you for your help.
I recommand uninstalling your current NodeJS version and install nvm instead.
Then you can manage all node version with nvm.
Method 1:
I followed this link and it was successful:
updating nodejs on ubuntu 16.04
Method 2:
You can either skip above link and follow the below steps:
Using Node Version Manager (NVM):
Install it by following instructions here
Test your installation:
close your current terminal, open a new terminal, and run:
command -v nvm
Use it to install as many versions as u like:
nvm install 8 # Install nodejs 8
nvm install --lts # Install latest LTS (Long Term Support) version
List installed versions:
nvm ls
Use a specific version:
nvm use 8 # Use this version on this shell
Set defaults:
nvm alias default 8 # Default to nodejs 8 on this shell
nvm alias default node # always use latest available as default nodejs for all shells
If you have npm installed -
run
sudo npm cache clean -f
sudo npm install -g n
install n globally
npm i -g n
then switch to the latest stable node version using n
n stable
I have
a remote serving running Ubuntu 14.04. I used apt to install node
a local OSx machine running El Capitan. I used hombrew to install node.
This results in the following.
Ubuntu 14.04
> sudo apt-get update
> sudo apt-get install node nodejs npm
> npm --version
1.3.10
> node --version
(emtpy)
> nodejs --version
v0.10.25
OSx
> brew install node
> npm --version
5.6.0
> nodejs --version
-bash: nodejs: command not found
> node --version
v8.11.3
Why are the apt repositories so out of date? The npm version on the server (1.3.10) is 4 versions behind that of OSx machin (5.6.0).
This npm issue even mentions that the apt repositories are quite old / not updated.
Is there a way to install a more recent version of npm on the Ubuntu server?
Download this tar file from nodejs official website
https://nodejs.org/dist/v8.11.4/node-v8.11.4.tar.gz
download, untar and install it via using the following command
sudo make test
sudo make install
It will install 8.11.4 version.
Please note that you can download any version of tar from nodejs officail page and can install it on your Ubuntu server and by using this method you don't need to update your apt packages.
I have found some guides (for ex. Install latest nodejs version in ubuntu 14.04) how to install updated version of NodeJS, also followed the official one that says to use
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
which is the same thing as in the SO guide above.
However, the version of node I get is 6.3.1 but I want the latest 6.7.0. I have installed 6.7.0 on OSX via brew but don't know how to get it on Ubuntu. Is there any way to do it, using APT preferably?
I have done this way:-
sudo npm install n -g
sudo n 6.7.0
Alternatively for latest stable version you can do this:-
sudo n stable
And For latest version
sudo n latest