avatar

sunday

Sunday's Blog

  • 首页
Home linux ubuntu安装最新的nodejs版本
文章

linux ubuntu安装最新的nodejs版本

Posted 2024-01-27 Updated 2024-01- 27
By sunday
3~4 min read

服务器ubuntu22.04上安装nodejs稳定版本

1.执行安装脚本

curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - 

sudo apt-get install -y nodejs

其中setup_lts.x 可以改成你想要安装的版本

比如18.x的最新的版本就执行

curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -

其他安装具体可查看

https://github.com/nodesource/distributions

2.如需安装多个版本,可使用node管理工具nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

#安装稳定的最新版本
nvm install --lts


#安装18.x最新版本
nvm install 18

具体可看:

https://github.com/nvm-sh/nvm

nodejs, 软件安装, 软件使用
软件使用 ubuntu nodejs
License:  CC BY 4.0
Share

Further Reading

Jul 13, 2024

利用github actions和aliyun私有镜像库,使用docker部署Nodejs项目

1.开通阿里云容器镜像服务个人版本

Apr 2, 2024

已安装的nginx,动态模块开启google brotli 压缩,并在vite项目中启用

1.下载ngx_brotli 到github https://github.com/google/ngx_brotli 然后git clone cd /usr/local/ git clone https://github.com/google/ngx_brotli.git cd /usr/loca

Jan 27, 2024

linux ubuntu安装最新的nodejs版本

服务器ubuntu22.04上安装nodejs稳定版本 1.执行安装脚本 curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - sudo apt-get install -y nodejs 其中setup_lts.x

OLDER

ubuntu22.04服务器内存不足,如何临时解决,启用交换内存

NEWER

docker-compose安装chatwoot客户互动系统

Recently Updated

  • nextjs使用three.js写一个3D模型的查看器Viewer
  • nextjs15使用better-sqlite3的连接报错问题
  • nextjs + clerk + supabase + realtime 实时监听数据库更改
  • 解决nextjs15使用useLocalStorage报错的问题
  • mac上使用nodejs appium控制chrome浏览器

Trending Tags

nginx acme 强制跳转HTTPS nodejs 代理 mac 神器 vue3 工具 docker

Contents

©2025 sunday. Some rights reserved.

Using the Halo theme Chirpy