skip to Main Content

I m trying to install nodejs 17.x but I end up installing nodejs 10.19. | OS : Ubuntu 20.04.4 LTS x86_64
| shell : fish shell
plz help… I need to install latest version of npm for my project but because of this problem I am stuck 🙁

I think curl is not working properly. I m noob I don’t know much of linux.

    $ cd ~
    $ curl -sL https://deb.nodesource.com/setup_17.x -o nodesource_setup.sh
    
    $ sudo bash nodesource_setup.sh

    ## Installing the NodeSource Node.js 17.x repo...
    
    
    ## Populating apt-get cache...
    
    + apt-get update
    Ign:1 https://repo.nordvpn.com/deb/nordvpn/debian stable InRelease
    Hit:2 http://dl.winehq.org/wine-builds/ubuntu focal InRelease                                                                                                                          
    Hit:3 http://in.archive.ubuntu.com/ubuntu focal InRelease                                                                                                                              
    Err:4 https://repo.nordvpn.com/deb/nordvpn/debian stable Release                                                                                                                       
      Could not handshake: Error in the pull function. [IP: 104.17.49.74 443]
    Hit:5 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease                                                                                                                      
    Get:6 http://repo.mysql.com/apt/ubuntu focal InRelease [12.9 kB]                                                                                                                       
    Get:7 https://packages.microsoft.com/repos/edge stable InRelease [7,342 B]                                                                                                             
    Hit:8 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease                                                                                                               
    Hit:9 http://ppa.launchpad.net/audio-recorder/ppa/ubuntu focal InRelease                                                                       
    Hit:10 https://deb.opera.com/opera-stable stable InRelease                                                                     
    Get:11 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]                                                     
    Err:6 http://repo.mysql.com/apt/ubuntu focal InRelease                                                               
      The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29
    Err:7 https://packages.microsoft.com/repos/edge stable InRelease                                                     
      The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
    Hit:12 http://ppa.launchpad.net/ethereum/ethereum/ubuntu focal InRelease                                             
    Hit:13 http://ppa.launchpad.net/fish-shell/release-3/ubuntu focal InRelease                                          
    Hit:14 http://ppa.launchpad.net/gencfsm/ppa/ubuntu focal InRelease                 
    Hit:15 https://dl.google.com/linux/chrome/deb stable InRelease                     
    Reading package lists... Done   
    E: The repository 'https://repo.nordvpn.com/deb/nordvpn/debian stable Release' does not have a Release file.
    N: Updating from such a repository can't be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://repo.mysql.com/apt/ubuntu focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29
    W: GPG error: https://packages.microsoft.com/repos/edge stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
    E: The repository 'https://packages.microsoft.com/repos/edge stable InRelease' is not signed.
    N: Updating from such a repository can't be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    Error executing command, exiting
    
    $ sudo apt install nodejs
    
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
      cmake-data libevent-2.1-7 libjsoncpp1 libnatpmp1 librhash0 transmission-common
    Use 'sudo apt autoremove' to remove them.
    Suggested packages:
      npm
    The following NEW packages will be installed:
      nodejs
    0 upgraded, 1 newly installed, 0 to remove and 24 not upgraded.
    Need to get 0 B/61.1 kB of archives.
    After this operation, 158 kB of additional disk space will be used.
    Selecting previously unselected package nodejs.
    (Reading database ... 284202 files and directories currently installed.)
    Preparing to unpack .../nodejs_10.19.0~dfsg-3ubuntu1_amd64.deb ...
    Unpacking nodejs (10.19.0~dfsg-3ubuntu1) ...
    Setting up nodejs (10.19.0~dfsg-3ubuntu1) ...
    update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode
    Processing triggers for man-db (2.9.1-1) ...
    
    $ node -v
    
    v10.19.0

3

Answers


  1. Have you tried pulling the latest update first? try

    sudo apt -y update && sudo apt -y upgrade
    curl -sL https://deb.nodesource.com/setup_17.x | sudo bash -
    sudo apt-get install -y nodejs
    
    

    Lmk if this works!
    p.s. sudo is like your admin user in windows. you will need to have superuser password as well!

    Login or Signup to reply.
  2. I would suggest you to use nvm to install and manage node.js versions.

    To install nvm on Ubuntu check this part of the docs

    And then it is easy to install / switch different versions of node.

    
    # nvm install <node_version>
    $ nvm install 12
    
    # nvm use <node_version>
    $ nvm use 12
    
    
    Login or Signup to reply.
  3. This also happened to me. I follow what is suggested here https://askubuntu.com/questions/1141035/error-executing-command-exiting

    # Remove the current installed nodejs
    sudo apt-get purge nodejs*
    
    # Remove every other apt sources
    sudo rm -rf /var/lib/apt/lists/* 
    sudo rm -rf /etc/apt/sources.list.d/* 
    sudo apt-get update 
    
    # Add the nodejs repository again
    curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -  
    sudo apt-get install -y nodejs
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search