在 Debian 系统上,我们可以使用其内置的包管理器对其安装 Node.js,但是官方包管理器的 Node.js 版本实在是太低了。我们就得需要使用到 Node.js 官方的安装脚本,来对其安装。这篇教程就来记录下 Debian 系统安装 Node.js 的操作步骤

准备材料

  • Debian 系统的设备

安装步骤

  1. SSH 登录进 VPS
  2. 输入以下命令

shell

1
2
3
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
apt-get install -y nodejs
sudo apt-get install yarn
  1. 输入 node --version 命令,查看 Node.js 版本为 18.x 即可