I was trying to install node into wsl2 (ubuntu 18.04) using binary distribution command:
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - &&\
sudo apt-get install -y nodejs
But I was getting this error when I run the command and node is not installed on wsl.
possibly this content is related to the error:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
nodejs : Depends: libc6 (>= 2.28) but 2.27-3ubuntu1.6 is to be installed
E: Unable to correct problems, you have held broken packages.
by the way I tried couple of commands such as:
sudo apt install libssl1.0-dev
sudo apt install nodejs-dev
sudo apt install node-gyp
sudo apt install npm
sudo apt install aptitude
sudo aptitude install libnode-dev
sudo aptitude install libnode64
sudo aptitude install node-gyp
sudo aptitude install npm
but none of them was able to solve the problem.
2.31-0ubuntu9.14
currently (which meets the >2.28 requirement in your paste!); you're using a release which ended its five years of standard support last year – guiverc Jan 03 '24 at 08:05