【问题标题】:Problem installing nodejs version >= 10 on Linux Mint 19.3, which stubbornly installs nodejs 8.10在 Linux Mint 19.3 上安装 nodejs 版本 >= 10 时出现问题,它顽固地安装 nodejs 8.10
【发布时间】:2021-05-30 23:04:59
【问题描述】:

尝试使用https://github.com/nodesource/distributions/blob/master/README.md 在 Linux Mint 19.3 上安装高于 10 版本的 nodejs(然后是 npm)。它顽固地安装8.10版本。

尝试使用来自https://unix.stackexchange.com/questions/538536/newest-version-of-nodejs-is-not-intalling-in-linux-mint-tina 的提示修复它,但是 1) "check_alt "Linux Mint" "tricia" "Ubuntu" "bionic" 已经在脚本中 2) 结果是一样的。

使用下载的安装脚本尝试使用 sudo apt-get install 和 wget,就像我上次尝试一样失败:

dag@Arokh:~/Desktop/tmp$ sudo apt-get remove nodejs
[sudo] password for dag:                 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libc-ares2 libhttp-parser2.7.1 libuv1 nodejs-doc
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  nodejs
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 18,0 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 331148 files and directories currently installed.)
Removing nodejs (8.10.0~dfsg-2ubuntu0.4) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
dag@Arokh:~/Desktop/tmp$ sudo ./setup_10.x 

## Installing the NodeSource Node.js 10.x repo...


## Populating apt-get cache...

+ apt-get update
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88,7 kB]    
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88,7 kB]      
Ign:4 http://packages.linuxmint.com tricia InRelease                           
Hit:5 https://deb.nodesource.com/node_10.x bionic InRelease                    
Hit:6 http://archive.canonical.com/ubuntu bionic InRelease                     
Get:7 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74,6 kB]    
Hit:8 http://packages.linuxmint.com tricia Release                             
Fetched 252 kB in 2s (137 kB/s)                                                
Reading package lists... Done

## You seem to be using Linux Mint version tricia.
## This maps to Ubuntu "bionic"... Adjusting for you...

## Confirming "bionic" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_10.x/dists/bionic/Release'

## Adding the NodeSource signing key to your keyring...

+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
OK

## Creating apt sources list file for the NodeSource Node.js 10.x repo...

+ echo 'deb https://deb.nodesource.com/node_10.x bionic main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src https://deb.nodesource.com/node_10.x bionic main' >> /etc/apt/sources.list.d/nodesource.list

## Running `apt-get update` for you...

+ apt-get update
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88,7 kB]    
Hit:3 http://archive.canonical.com/ubuntu bionic InRelease                     
Hit:4 https://deb.nodesource.com/node_10.x bionic InRelease                    
Get:5 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88,7 kB]      
Ign:6 http://packages.linuxmint.com tricia InRelease                           
Get:7 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74,6 kB]
Hit:8 http://packages.linuxmint.com tricia Release                             
Fetched 252 kB in 2s (140 kB/s)                   
Reading package lists... Done

## Run `sudo apt-get install -y nodejs` to install Node.js 10.x and npm
## You may also need development tools to build native addons:
     sudo apt-get install gcc g++ make
## To install the Yarn package manager, run:
     curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
     echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
     sudo apt-get update && sudo apt-get install yarn


dag@Arokh:~/Desktop/tmp$ sudo apt-get update
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88,7 kB]
Hit:2 http://archive.canonical.com/ubuntu bionic InRelease                     
Hit:3 https://deb.nodesource.com/node_10.x bionic InRelease                    
Hit:4 http://archive.ubuntu.com/ubuntu bionic InRelease                        
Get:5 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88,7 kB]      
Ign:6 http://packages.linuxmint.com tricia InRelease                           
Hit:7 http://packages.linuxmint.com tricia Release                             
Get:8 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74,6 kB]
Fetched 252 kB in 2s (139 kB/s)                                   
Reading package lists... Done
dag@Arokh:~/Desktop/tmp$ sudo apt-get install -y nodejs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  nodejs
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/4 845 kB of archives.
After this operation, 18,0 MB of additional disk space will be used.
Selecting previously unselected package nodejs.
(Reading database ... 331139 files and directories currently installed.)
Preparing to unpack .../nodejs_8.10.0~dfsg-2ubuntu0.4_i386.deb ...
Unpacking nodejs (8.10.0~dfsg-2ubuntu0.4) ...
Setting up nodejs (8.10.0~dfsg-2ubuntu0.4) ...
update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
dag@Arokh:~/Desktop/tmp$ node -v
v8.10.0

【问题讨论】:

    标签: node.js linux ubuntu linux-mint linux-mint-19


    【解决方案1】:

    对于节点版本 10

    $ sudo apt-get install curl python-software-properties software-properties-common
    $ curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -
    $ sudo apt-get install nodejs
    

    但是尝试安装最新的,因为我看到帖子是在 Mar2021 并且 Node 版本是 10,你可能会收到类似的消息

                              DEPRECATION WARNING                            
    

    不再积极支持 Node.js 10.x!

    您不会收到此版本的安全或关键稳定性更新。

    您应该尽快迁移到受支持的 Node.js 版本。 使用与你的Node.js版本对应的安装脚本 希望安装。例如

    请参阅https://github.com/nodejs/Release 了解有关哪个 版本可能适合您。

    NodeSource Node.js 分发存储库包含 有关支持的 Node.js 版本和支持的 Linux 的信息 分布。要了解有关使用的更多信息,请参阅存储库: https://github.com/nodesource/distributions

    最新版本

    $ sudo apt-get install curl python-software-properties software-properties-common
    $ curl -sL https://deb.nodesource.com/setup_15.x | sudo bash -
    

    对于 LTS 版本

    $ sudo apt-get install curl python-software-properties software-properties-common
    $ curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
    
    $ sudo apt-get install nodejs
    $ node -v
    

    【讨论】:

      【解决方案2】:

      我按照以下链接中描述的步骤进行升级,希望对您有所帮助:

      https://phoenixnap.com/kb/update-node-js-version

      我选择了第一个选项来使用 NVM(节点版本管理器)更新 Node.js

      【讨论】:

      • avoid link only answers。答案“仅是指向外部网站的链接”may be deleted
      • 按照链接程序使用 nvm。在半个多小时前执行“nvm install v14.6.0”后,该过程仍然很强劲。我想知道它是否处于循环中。
      • 对我来说不是这样。它立即安装。我想知道它是否与网络有关。
      • 最终我安装了 Linux Mint 20.1,它默认安装更新版本的 npm 和 node。
      猜你喜欢
      • 2020-08-28
      • 2021-05-07
      • 1970-01-01
      • 1970-01-01
      • 2017-06-21
      • 1970-01-01
      • 1970-01-01
      • 2016-12-10
      • 1970-01-01
      相关资源
      最近更新 更多