给正在运行的docker容器安装Node.js


# 进入容器
docker exec -it <container_name> bash

# 安装 Node.js
apt update
apt install -y curl
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
apt install -y nodejs

# 验证
node -v
npm -v

posted @ 2025-04-18 15:25  HookDing  阅读(30)  评论(0)    收藏  举报