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
相关推荐
墨水白云8 小时前
nestjs[一文学懂nestjs中对npm功能包的封装,ioredis封装示例]
前端·npm·node.js
低代码布道师8 小时前
第五部分:第一节 - Node.js 简介与环境:让 JavaScript 走进厨房
开发语言·javascript·node.js
Growthofnotes14 小时前
VSCode中Node.js 使用教程
ide·vscode·node.js
王佳斌14 小时前
node.js文件系统(fs) - 创建文件、打开文件、写入数据、追加数据、读取数据、创建目录、删除目录
node.js
bloglin9999916 小时前
npm和nvm和nrm有什么区别
前端·npm·node.js
哎哟喂_!17 小时前
Node.js 同步加载问题详解:原理、危害与优化策略
前端·chrome·node.js
一小池勺17 小时前
Node.js事件循环中的FIFO原则
node.js
Q_Q196328847517 小时前
python的家教课程管理系统
开发语言·spring boot·python·django·flask·node.js·php
chilavert31821 小时前
说一说Node.js高性能开发中的I/O操作
node.js
蜡笔小柯南1 天前
解决:npm install报错,reason: certificate has expired
前端·npm·node.js