Ubuntu安装Node.js

Ubuntu安装Node.js

官网:

python 复制代码
https://nodejs.org/en/download
python 复制代码
# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash

# in lieu of restarting the shell
\. "$HOME/.nvm/nvm.sh"

# Download and install Node.js:
nvm install 24

# Verify the Node.js version:
node -v # Should print "v24.14.0".

# Verify npm version:
npm -v # Should print "11.9.0".

也可以使用Docker方式安装,指令如下:

python 复制代码
# Docker has specific installation instructions for each operating system.
# Please refer to the official documentation at https://docker.com/get-started/

# Pull the Node.js Docker image:
docker pull node:24-alpine

# Create a Node.js container and start a Shell session:
docker run -it --rm --entrypoint sh node:24-alpine

# Verify the Node.js version:
node -v # Should print "v24.14.0".

# Verify npm version:
npm -v # Should print "11.9.0".
相关推荐
mounter6253 分钟前
Linux 内核热升级(Live Update)技术详解:PCI、VFIO 与 IOMMU 子系统的演进与实战解析引言
linux·linux kernel·kernel·iommu·vfio
砚凝霜25 分钟前
【软考信息安全】第十九章 Unix/Linux安全分析与防护
linux·安全·unix
creator_Li1 小时前
Linux 的 Page Cache
linux·page cache
孟陬2 小时前
Node.js 中 `\b` 的作用
node.js·bun
KING-WU5123 小时前
Linux GDB 调试实战指南:从编译到断点调试
linux·运维·服务器
Lucis__3 小时前
深入理解程序链接与加载—从动静态链接到库加载
linux·elf·链接·程序·动静态库
影视飓风TIM3 小时前
Linux 进程信号原理与剖析
linux·运维·服务器
缘友一世3 小时前
开源 Linux截图工具闪构(SnapForge)
linux·运维·ubuntu·开源·截图
人工智能和FPGA AI技术4 小时前
wbuntu 极点五笔输入法安装记录(两种方法)
ubuntu·软件构建
朱包林4 小时前
iTerm2终端配置指南
linux·javascript·python·云原生·容器·kubernetes·云计算