温馨提示×

debian如何查nodejs版本

小樊
40
2026-09-17 12:34:46
栏目: 编程语言

在 Debian 系统上查看 Node.js 版本,常用方法如下:

1. 使用 node 命令(最常用)

node -v

node --version

2. 查看 npm 版本(如果已安装)

npm -v

3. 如果提示 command not found

说明可能未安装,或用其他方式管理(如 nvm):

  • 检查是否安装:
which node
  • 用 nvm 管理时:
nvm ls

4. 用包管理工具查看(已通过 apt 安装)

dpkg -l | grep nodejs

apt list --installed | grep nodejs

5. 查看详细版本信息

node -p process.versions

如果你是刚装好 Debian 想确认 Node 是否可用,直接运行 node -v 最简单。

0