Debian 里安装东西一般都比较简单,使用apt-get就行,但是Debian 9源里的Nodejs版本太老了

  • # nodejs -v
  • v4.8.4
复制

上网搜了一下,可以使用nodesource提供的源来安装Nodejs 14。

先安装nodesource

  • apt-get install curl
  • curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
复制

然后安装 Nodejs 和 npm

  • apt-get update
  • apt-get install nodejs
复制

查看版本号

  • # nodejs -v
  • v14.17.1
复制