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".
相关推荐
letisgo524 分钟前
VMware Workstation + Ubuntu 26.04 LTS 小白运维部署手册
linux·运维·ubuntu
IT探索37 分钟前
Linux 查找文件指令总结
linux·算法
晚风吹长发39 分钟前
Docker使用——Docker容器及相关命令
linux·运维·服务器·docker·容器·架构
sulikey1 小时前
个人Linux操作系统学习笔记11 - 环境变量
linux·笔记·学习
Kina_C1 小时前
NFS与Autofs快速讲解-从原理到实战配置
linux·nfs·autofs
皮卡狮1 小时前
文件系统:磁盘硬件寻址和系统软件寻址
linux
csdn2015_1 小时前
nodejs安装
node.js·vue
是潮汕的灿灿展吖1 小时前
Centos离线部署nfs操作
linux·运维·centos
Kina_C2 小时前
Apache HTTP Server 安装、配置与高级功能详解
linux·http·apache
治愈系贝壳2 小时前
ARM --- day 6 时钟
linux·arm开发·学习