在 Debian 上安装 Node.js 的方式有多种,本文将介绍两种常用方法:通过包管理器(APT)以及通过 NodeSource 仓库进行安装。
方法一:通过包管理器(APT)安装
sudo apt update
sudo apt install nodejs npm
node --version npm --version
方法二:通过 NodeSource 仓库安装
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
如果您希望安装特定版本,例如 14.x,运行:
curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
node --version npm --version
至此,您已在 Debian 系统上成功安装了 Node.js 和 npm。现在,您可以利用它们来运行和部署您的 Node.js 应用程序了。
以上就是如何在 Debian 上安装 Node.js的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号