安装nodejs遇到问题

Ani*_*ari 7 linux ubuntu node.js npm

我在尝试安装 Node.js 时遇到问题。检查错误时,它需要升级 libc6,但我找不到任何方法为 Ubuntu 18.04 升级 libc6。

旧的nodejs版本我已经用以下命令卸载了它

sudo apt-get remove nodejs
sudo apt-get remove npm
Run Code Online (Sandbox Code Playgroud)

问题

    sudo apt-get install -y nodejs
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    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.
Run Code Online (Sandbox Code Playgroud)

我已经浏览了这些链接链接2链接3,但没有得到任何帮助

Ani*_*ari 12

我已经通过使用旧版本的节点解决了该问题。要永久解决该问题,需要升级 Ubuntu

curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs 
Run Code Online (Sandbox Code Playgroud)