Ubuntu22.04使用NVM安装多版本Node.js和版本切换

Fabric官方目前支持Node.js开发区块链应用,建议使用Node长期支持版本(LTS)。

建议使用NVM安装Node.js,NVM可以帮助我们方便的在Node的不同版本之间进行切换,这样我们就可以同时工作在不同的项目上。

下面是安装的脚本:

bash 复制代码
# To download and install the nvm script run:
# 下载并安装nvm脚本:
# 当前为0.39.7版本
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

# close and reopen the terminal or run the commands to add the path to nvm script to the current shell session.
# 切记nvm安装完毕,要么重新打开终端,要么设置nvm环境变量:

# 查询远程lts node
$ nvm ls-remote --lts

# Using nvm install node
# default install npm
# 使用nvm安装node:
$ nvm install 8.17.0
$ nvm install 10.24.1

#To list installed Node.js versions type:
#显示已经安装node版本:
$ nvm ls

#You can change the currently active version with:
#选择使用node版本,这里使用了10.0.0版本:
$ nvm use 10.24.1
相关推荐
嘿嘻哈呀5 小时前
Node.js和包管理工具
node.js
winfredzhang5 小时前
构建自动化 Node.js 项目管理工具:从文件夹监控到一键联动运行
chrome·python·sqlite·node.js·端口·运行js
winfredzhang6 小时前
实战:从零构建一个支持屏幕录制与片段合并的视频管理系统 (Node.js + FFmpeg)
ffmpeg·node.js·音视频·录屏
shughui6 小时前
2026最新版Node.js下载安装、版本选择 及 环境配置教程(详细图文附安装包)
node.js
小李子呢02116 小时前
Node.js
开发语言·前端·学习·node.js
心.c6 小时前
文件上传 - 入门篇
前端·javascript·vue.js·node.js·js
xiaoxue..7 小时前
Nest.js 框架 企业级开发通关手册
面试·typescript·node.js·开发框架·nest.js
20年编程老鸟java+ai全栈1 天前
零基础搞定开发环境:PHP + Node.js + MongoDB + Python 一键安装全攻略
python·mongodb·node.js·php
ggaofeng1 天前
实践NPM打包和使用
前端·npm·node.js
1telescope1 天前
MacBook 安装 nvm 管理 Node.js 多版本教程
macos·node.js