无法安装最新版本的nodejs。我尝试安装nodejs 17.x

发布于 2025-02-13 17:47:52 字数 5527 浏览 0 评论 0原文

我尝试安装nodejs 17.x,但我最终安装了nodejs 10.19。 | OS:Ubuntu 20.04.4 LTS X86_64 |外壳:鱼壳
请帮助...我需要为我的项目安装最新版本的NPM,但是由于这个问题,我被卡住了:(
我认为卷发无法正常工作。我是菜鸟,我对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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

So要识趣 2025-02-20 17:47:52

使用NVM节点安装程序,这是最好的简单方法。

  1. 在终端
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
  1. 更新配置文件配置中执行此操作,例如
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
  1. Reload shell
source ~/.bashrc
  1. 安装,然后使用像此
nvm install 18
nvm use 18
  1. 重新加载shell这样的节点,然后通过node -v进行检查。

谢谢。

Use nvm node installer it is the best and simple way.

  1. Do this in the terminal
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
  1. Update profile config like this
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
  1. Reload shell
source ~/.bashrc
  1. Install and use node like this
nvm install 18
nvm use 18
  1. Reload the shell again and check by node -v.

Thanks.

静谧幽蓝 2025-02-20 17:47:52

我建议您使用 nvm 来安装和管理node.js版本。

要在Ubuntu

https://github.com/nvm-sh/nvm-shremnvm-#installing-and------易于安装 /切换不同版本的节点。


# nvm install <node_version>
$ nvm install 12

# nvm use <node_version>
$ nvm use 12

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

寄居人 2025-02-20 17:47:52

您是否尝试过首先提取最新更新? 请尝试

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!
PS Sudo就像Windows中的管理用户一样。您也需要拥有SuperSul Password!

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!

别低头,皇冠会掉 2025-02-20 17:47:52

这也发生在我身上。我遵循此处建议的内容 https://askubuntu.com/questions/questions/1141035/error-error-error-earlor-ecreting-command-command-command--command--command--command-in-退出

# 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

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文