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
相关推荐
RoyLin6 小时前
TypeScript设计模式:原型模式
前端·后端·node.js
RoyLin10 小时前
TypeScript设计模式:单例模式
前端·后端·node.js
RoyLin10 小时前
TypeScript设计模式:工厂方法模式
前端·后端·node.js
RoyLin10 小时前
TypeScript设计模式:模板方法模式
前端·后端·node.js
RoyLin1 天前
TypeScript设计模式:适配器模式
前端·后端·node.js
RoyLin1 天前
TypeScript设计模式:迭代器模式
javascript·后端·node.js
前端双越老师1 天前
2025 年还有前端不会 Nodejs ?
node.js·agent·全栈
人工智能训练师2 天前
Ubuntu22.04如何安装新版本的Node.js和npm
linux·运维·前端·人工智能·ubuntu·npm·node.js
Seveny072 天前
pnpm相对于npm,yarn的优势
前端·npm·node.js
huangql5202 天前
npm 发布流程——从创建组件到发布到 npm 仓库
前端·npm·node.js