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".
相关推荐
M78佐菲3 小时前
ARM学习笔记(1)
linux·arm开发·笔记·嵌入式硬件·学习
益达丫4 小时前
Socket编程揭秘:端口、IP与进程通信的底层逻辑
linux·笔记
chicheese7 小时前
Linux 面试速查表:从初级到高级,附高频场景答题模板
linux·运维
Linux-lucky7 小时前
32-38-Linux学习之旅之MySQL综合
linux·运维·学习·mysql·ubuntu
vortex58 小时前
常用终端模拟器全面对比:Kitty、WezTerm、Ghostty 与 Konsole
linux
INGNIGHT9 小时前
270 · 电话号码的字母组合II(Trie)
linux·算法
zly35009 小时前
VMware Converter Standalone 物理机转化为虚拟机后源1硬盘变成了2个硬盘(2个硬盘文件)虚拟机无法启动。
linux·运维·服务器
GeW11 小时前
从内核到数据:Linux与工业数据库如何支撑高端制造
linux
小小的木头人12 小时前
Linux systemd Service 与 Timer 定时任务原理及实战
linux
flash俊杰13 小时前
Electron 打包后窗口 30 秒不出现:一个 ABI 不匹配的血案
electron·node.js