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".
相关推荐
MIXLLRED15 小时前
Ubuntu22.04 + ROS2 Humble 安装部署 PCT Planner
ubuntu·ros2·三维路径规划·pct
米丘15 小时前
HTTP 强缓存 和 协商缓存 (浏览器缓存)
http·node.js·浏览器
ulias21215 小时前
深挖进程间通信的奥秘
java·linux·服务器·开发语言·c++·算法
AOwhisky15 小时前
MySQL 学习笔记(第三期):SQL 语言之数据操作与单表查询
linux·运维·笔记·sql·学习·mysql·云计算
键盘上的猫头鹰16 小时前
【Linux 基础教程(四)】文件内容查看、打包压缩与搜索、重定向管道及环境变量
linux·服务器·python
tellmewhoisi16 小时前
linux 基础知识(文件权限相关)
linux·运维·服务器
jiayong2316 小时前
Claude Code 常见操作实战指南
linux·服务器·网络·ai·claude·claude code
醇氧17 小时前
【Linux 】sudo、sudo -i、su、su - 完整区别总结
linux·运维·服务器
xiaoye-duck17 小时前
《Linux系统编程》System V IPC 进阶:消息队列与信号量从入门到内核
linux
代码熬夜敲Q17 小时前
网络工程相关
linux·服务器·网络