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
相关推荐
m0_380743871 小时前
从零调用 Claude 教程
开发语言·python·node.js
烬羽5 小时前
从 nest new 到 Hello World:一个最小 NestJS 项目,讲透工厂 + 装饰器 + 模块化
设计模式·node.js·nestjs
渔夫正在掘金7 小时前
Cordis 中文教程:渐进式构建插件化应用
前端·node.js·ai编程
大家的林语冰10 小时前
✌️ 让 Rust 再次伟大,pnpm 12 抛弃 TypeScript,移植 Rust 原地起飞!
前端·javascript·node.js
抓不住时间的沙12 小时前
butterfly主题美化,打造属于自己的个性博客
java·开发语言·前端·javascript·node.js·github
抓不住时间的沙14 小时前
N1搭建Hexo个人博客,部署到Github
python·docker·node.js·debian·github·arm
必须会一定会14 小时前
Node.js Agent Handoff 仓库扫描 MVP:忽略规则、include 通配与稳定输出实现
人工智能·node.js·ai编程
八角丶1 天前
Node.js Cluster 详解
前端·node.js
濮水大叔1 天前
CabloyJS 强大之处不仅仅是 IoC,而是全栈资源的寻址体系
typescript·node.js·全栈
烂蜻蜓1 天前
Node.js入门教程(二十六):内置模块
node.js