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".
相关推荐
sxstj34 分钟前
Ubuntu 完整安装并启用 Flatpak 教程
linux·运维·ubuntu
天疆说1 小时前
Ubuntu 26.04 下 Intel Meteor Lake 核显 + NPU 驱动配置与 PyTorch NPU 推理实测
linux·pytorch·ubuntu
mounter6252 小时前
突破单点限制:BPF 多跟踪点高效附加机制与新 ftrace 架构解析
linux·ebpf·linux kernel·kernel·ftrace
刘某的Cloud2 小时前
Galera Cluster部署 mariadb 节点down机,log sequence number恢复
linux·运维·数据库·负载均衡·mariadb·集群·高可用
小此方2 小时前
Re:Linux系统篇(五十四)线程篇 · 七:互斥锁的底层实现原理:从硬件上下文、原子交换指令(Swap)到并发封装实战
linux·运维·驱动开发
meilindehuzi_a2 小时前
TypeScript面试题:interface 与 type:相同点、核心区别与选择指南
java·ubuntu·typescript
郭涤生2 小时前
rootfs 详解与裁剪优化记录
linux·c++·bsp
铁锚3 小时前
解决Ubuntu执行sudo时 unable to resolve host 报错问题
linux·数据库·ubuntu
二宝哥3 小时前
CentOS 7.9 离线安装 Nginx 并配置openssl1.1.1
linux·nginx·centos
程序员老陆3 小时前
说一说FFmpeg6在Linux平台的编译
linux·运维·服务器·ffmpeg