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".
相关推荐
codingWhat2 小时前
能效平台设计方案(打通gitlab和飞书)
后端·node.js·koa
tntxia14 小时前
linux curl命令详解_curl详解
linux
扛枪的书生17 小时前
Linux 网络管理器用法速查
linux
顺风尿一寸19 小时前
Java Socket 内核之旅:从 SocketChannel.read() 到 tcp_recvmsg 与 epoll 的完整调用链路
linux
XIAOHEZIcode1 天前
Ubuntu 终端美化全栈指南:Bash 到 Kitty 踩坑实录
linux·ubuntu·命令行
唐青枫1 天前
别再只会用 cron:Linux systemd Timer 定时任务实战详解
linux
见过夏天2 天前
Node.js 常用命令全攻略
node.js
前端双越老师2 天前
我从 0 开发的 AI Agent 智语项目发布了
前端·node.js·agent
kyriewen3 天前
2026 年了,还在用 Node.js?Bun 迁移实战:20 分钟搞定,附踩坑记录
前端·javascript·node.js
AlfredZhao3 天前
生产环境里,为什么不建议把普通端口直接暴露到公网?
linux·https·443·80