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
相关推荐
嘵奇29 分钟前
Node.js二:第一个Node.js应用
node.js
m0_748252389 小时前
Node.js HTTP模块详解:创建服务器、响应请求与客户端请求
服务器·http·node.js
m0_748234081 天前
Node.js使用教程
node.js·编辑器·vim
雲小妖1 天前
PowerShell 执行策略:fnm管理软件安装nodejs无法运行npm,错误信息:about_Execution_Policies
前端·npm·node.js
qq_530245191 天前
nvm下载node版本npm下载失败
前端·npm·node.js·nvm
Winson℡1 天前
在使用 npm link 进行本地 npm 包调试时,是否需要删除项目中已安装的依赖包取决于你的调试场景和依赖管理方式
前端·npm·node.js
糖果店的幽灵2 天前
Ubuntu 安装 Node.js 20.x
linux·ubuntu·node.js
AlgorithmAce2 天前
解决npm/yarn等包管理工具在vscode中使用出现系统禁止运行脚本的情况
前端·npm·node.js
超级无敌谢大脚2 天前
前端包管理工具进化论:npm vs yarn vs pnpm 深度对比
前端·npm·node.js
i建模2 天前
Windows前端开发IDE选型全攻略
前端·ide·windows·node.js·编辑器·visual studio code