How to install nodejs with nvm on Linux mint 22.1
nvm是nodejs官方用于管理nodejs多版本环境的一个工具 ,今天,我带领大家基于nvm完成nodejs在Linux mint 22.1上的安装。
考虑到Linux mint 22.1是基于ubuntu 24.04.1 LTS的,所以,这里的安装也完全适用于nodejs在nodejs上的安装。
不过,我们看到,nodejs官方给出的说明,主流Linux发行版都是可以基于nvm来安装的,这一点非常的好,我们再也不用针对不同Linux发行版采用不同的安装方式了。
Install nvm
lwk@qwfys:~$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash% Total % Received % Xferd Average Speed Time Time Time CurrentDload Upload Total Spent Left Speed
100 16563 100 16563 0 0 12373 0 0:00:01 0:00:01 --:--:-- 12378
=> Downloading nvm from git to '/home/lwk/.nvm'
=> Cloning into '/home/lwk/.nvm'...
remote: Enumerating objects: 381, done.
remote: Counting objects: 100% (381/381), done.
remote: Compressing objects: 100% (324/324), done.
remote: Total 381 (delta 43), reused 175 (delta 29), pack-reused 0 (from 0)
Receiving objects: 100% (381/381), 383.82 KiB | 662.00 KiB/s, done.
Resolving deltas: 100% (43/43), done.
* (HEAD detached at FETCH_HEAD)master
=> Compressing and cleaning up git repository=> Appending nvm source string to /home/lwk/.bashrc
=> Appending bash_completion source string to /home/lwk/.bashrc
=> Close and reopen your terminal to start using nvm or run the following to use it now:export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
lwk@qwfys:~$
这个时候,nvm已经安装成功,不过重新打一个命令行终端。
Install nodejs
这里,我们重新开启一个命令行终端,尝试下一nvm命令可否正常使用。
lwk@qwfys:~$ nvmNode Version Manager (v0.40.1)Note: <version> refers to any version-like string nvm understands. This includes:- full or partial version numbers, starting with an optional "v" (0.10, v0.1.2, v1)- default (built-in) aliases: node, stable, unstable, iojs, system- custom aliases you define with `nvm alias foo`Any options that produce colorized output should respect the `--no-colors` option.Usage:nvm --help Show this message--no-colors Suppress colored outputnvm --version Print out the installed version of nvmnvm install [<version>] Download and install a <version>. Uses .nvmrc if available and version is omitted.The following optional arguments, if provided, must appear directly after `nvm install`:-s Skip binary download, install from source only.-b Skip source download, install from binary only.--reinstall-packages-from=<version> When installing, reinstall packages installed in <node|iojs|node version number>--lts When installing, only select from LTS (long-term support) versions--lts=<LTS name> When installing, only select from versions for a specific LTS line--skip-default-packages When installing, skip the default-packages file if it exists--latest-npm After installing, attempt to upgrade to the latest working npm on the given node version--no-progress Disable the progress bar on any downloads--alias=<name> After installing, set the alias specified to the version specified. (same as: nvm alias <name> <version>)--default After installing, set default alias to the version specified. (same as: nvm alias default <version>)--save After installing, write the specified version to .nvmrcnvm uninstall <version> Uninstall a versionnvm uninstall --lts Uninstall using automatic LTS (long-term support) alias `lts/*`, if available.nvm uninstall --lts=<LTS name> Uninstall using automatic alias for provided LTS line, if available.nvm use [<version>] Modify PATH to use <version>. Uses .nvmrc if available and version is omitted.The following optional arguments, if provided, must appear directly after `nvm use`:--silent Silences stdout/stderr output--lts Uses automatic LTS (long-term support) alias `lts/*`, if available.--lts=<LTS name> Uses automatic alias for provided LTS line, if available.--save Writes the specified version to .nvmrc.nvm exec [<version>] [<command>] Run <command> on <version>. Uses .nvmrc if available and version is omitted.The following optional arguments, if provided, must appear directly after `nvm exec`:--silent Silences stdout/stderr output--lts Uses automatic LTS (long-term support) alias `lts/*`, if available.--lts=<LTS name> Uses automatic alias for provided LTS line, if available.nvm run [<version>] [<args>] Run `node` on <version> with <args> as arguments. Uses .nvmrc if available and version is omitted.The following optional arguments, if provided, must appear directly after `nvm run`:--silent Silences stdout/stderr output--lts Uses automatic LTS (long-term support) alias `lts/*`, if available.--lts=<LTS name> Uses automatic alias for provided LTS line, if available.nvm current Display currently activated version of Nodenvm ls [<version>] List installed versions, matching a given <version> if provided--no-colors Suppress colored output--no-alias Suppress `nvm alias` outputnvm ls-remote [<version>] List remote versions available for install, matching a given <version> if provided--lts When listing, only show LTS (long-term support) versions--lts=<LTS name> When listing, only show versions for a specific LTS line--no-colors Suppress colored outputnvm version <version> Resolve the given description to a single local versionnvm version-remote <version> Resolve the given description to a single remote version--lts When listing, only select from LTS (long-term support) versions--lts=<LTS name> When listing, only select from versions for a specific LTS linenvm deactivate Undo effects of `nvm` on current shell--silent Silences stdout/stderr outputnvm alias [<pattern>] Show all aliases beginning with <pattern>--no-colors Suppress colored outputnvm alias <name> <version> Set an alias named <name> pointing to <version>nvm unalias <name> Deletes the alias named <name>nvm install-latest-npm Attempt to upgrade to the latest working `npm` on the current node versionnvm reinstall-packages <version> Reinstall global `npm` packages contained in <version> to current versionnvm unload Unload `nvm` from shellnvm which [current | <version>] Display path to installed node version. Uses .nvmrc if available and version is omitted.--silent Silences stdout/stderr output when a version is omittednvm cache dir Display path to the cache directory for nvmnvm cache clear Empty cache directory for nvmnvm set-colors [<color codes>] Set five text colors using format "yMeBg". Available when supported.Initial colors are:bygreColor codes:r/R = red / bold redg/G = green / bold greenb/B = blue / bold bluec/C = cyan / bold cyanm/M = magenta / bold magentay/Y = yellow / bold yellowk/K = black / bold blacke/W = light grey / white
Example:nvm install 8.0.0 Install a specific version numbernvm use 8.0 Use the latest available 8.0.x releasenvm run 6.10.3 app.js Run app.js using node 6.10.3nvm exec 4.8.3 node app.js Run `node app.js` with the PATH pointing to node 4.8.3nvm alias default 8.1.0 Set default node version on a shellnvm alias default node Always default to the latest available node version on a shellnvm install node Install the latest available versionnvm use node Use the latest versionnvm install --lts Install the latest LTS versionnvm use --lts Use the latest LTS versionnvm set-colors cgYmW Set text colors to cyan, green, bold yellow, magenta, and whiteNote:to remove, delete, or uninstall nvm - just remove the `$NVM_DIR` folder (usually `~/.nvm`)lwk@qwfys:~$
我们看到,nvm已经可以正常使用,拉下来,我们借助nvm install命令完成尝试安装一下nodejs 18。
lwk@qwfys:~$ nvm install 18
Downloading and installing node v18.20.7...
Downloading https://nodejs.org/dist/v18.20.7/node-v18.20.7-linux-x64.tar.xz...
######################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v18.20.7 (npm v10.8.2)
Creating default alias: default -> 18 (-> v18.20.7)
lwk@qwfys:~$
这里,我们看到,nodejs 18已经安装成功。
View
这里,我们查看一下nodejs命令行可否正常使用。
lwk@qwfys:~$ nodejs
Command 'nodejs' not found, but can be installed with:
sudo apt install nodejs
lwk@qwfys:~$ node
Welcome to Node.js v18.20.7.
Type ".help" for more information.
> .help
.break Sometimes you get stuck, this gets you out
.clear Alias for .break
.editor Enter editor mode
.exit Exit the REPL
.help Print this help message
.load Load JS from a file into the REPL session
.save Save all evaluated commands in this REPL session to a filePress Ctrl+C to abort current expression, Ctrl+D to exit the REPL
> .exit
lwk@qwfys:~$
我们看到,使用node命令即可。
相关文章:
How to install nodejs with nvm on Linux mint 22.1
nvm是nodejs官方用于管理nodejs多版本环境的一个工具 ,今天,我带领大家基于nvm完成nodejs在Linux mint 22.1上的安装。 考虑到Linux mint 22.1是基于ubuntu 24.04.1 LTS的,所以,这里的安装也完全适用于nodejs在nodejs上的安装。 …...
JmeterHttp请求头管理出现Unsupported Media Type问题解决
JmeterHttp请求头管理出现Unsupported Media Type问题解决 大多数的app与pc端压测的时候都会出现这种情况 当我们在jemter测试当中当中遇见Unsupported Media Type,有一种可能就是我们请求的网页的content-Type的类型与我们测试的时候的类型不一致 解决方法 可以添…...
十大数据科学Python库
十大数据科学Python库 1、NumPy:脊髓2、Pandas:数据操纵专家3、Matplotlib:艺术之魂4、Scikit-Learn:瑞士军刀5、TensorFlow:聪明的家伙6、PyTorch:叛逆者7、Selenium:操纵大师8、NLTKÿ…...
LabVIEW伺服阀高频振动测试
在伺服阀高频振动测试中,闭环控制系统的实时性与稳定性至关重要。针对用户提出的1kHz控制频率需求及Windows平台兼容性问题,本文重点分析NI PCIe-7842R实时扩展卡的功能与局限性,并提供其他替代方案的综合对比,以帮助用户选择适合…...
解决asp.net mvc发布到iis下安全问题
解决asp.net mvc发布到iis下安全问题 环境信息1.The web/application server is leaking version information via the "Server" HTTP response2.确保您的Web服务器、应用程序服务器、负载均衡器等已配置为强制执行Strict-Transport-Security。3.在HTML提交表单中找不…...
CSS-基础选择器,字体属性,文本属性介绍
一、CSS 简介 CSS 是层叠样式表 ( Cascading Style Sheets ) 的简称. 有时我们也会称之为 CSS 样式表或级联样式表。 CSS 是也是一种标记语言 CSS 主要用于设置 HTML 页面中的文本内容(字体、大小、对齐方式等)、图片的外形(宽高&a…...
git submodule管理的仓库怎么删除子仓库
删除 Git 子模块需要执行一系列步骤,以确保从项目中彻底移除子模块及其相关配置。以下是详细的步骤: 1. 取消初始化子模块 运行以下命令以取消子模块的初始化,这会从 .git/config 文件中移除子模块的配置: git submodule deini…...
vtkDepthSortPolyData 根据相机视图方向对多边形数据进行排序
1. 作用 在 3D 渲染中,透明对象的渲染顺序非常重要。如果透明对象的渲染顺序不正确,可能会导致错误的视觉效果(例如,远处的透明对象遮挡了近处的透明对象)。vtkDepthSortPolyData 通过对多边形数据进行深度排序&#…...
菜鸟开发之MySQL常见字段值处理
仰天大笑出门去,我辈更要谱天曲。 SQL一日同风起,基础不夯注定倾。 众里寻它千百度,蓦然回首,那个错误还在吐。 Java开发该过程中性能问题是存在的,而数据处理则是占据大头,平时开发一定要注意代码质量和…...
ubuntu-学习笔记-nginx+php
nginxphp nginx下载nginx配置nginx.conf php其他 记录一下在ubuntu中nginxphp部署tp项目 nginx nginx就是正常下载 下载nginx sudo apt-get install nginx tp项目版本是3.2,通过设置路由,以域名/api.php/控制器/xxx的格式进行api的调用,文…...
【MySQL_04】数据库基本操作(用户管理--配置文件--远程连接--数据库信息查看、创建、删除)
文章目录 一、MySQL 用户管理1.1 用户管理1.11 mysql.user表详解1.12 添加用户1.13 修改用户权限1.14 删除用户1.15 密码问题 二、MySQL 配置文件2.1 配置文件位置2.2 配置文件结构2.3 常用配置参数 三、MySQL远程连接四、数据库的查看、创建、删除4.1 查看数据库4.2 创建、删除…...
牛客网刷题(5)(HTML之元素<input>、表格<table>与描述列表<dl>、元素<label>)
目录 一、哪种输入类型定义滑块控件?元素(input) (1)官方解析。 (2)总结。 (3)牛客大佬总结。 (4)HTML5——元素(input)的…...
语音视频App协议安全实战:防御伪造/窃听/Deepfake攻击
一、SDP协议安全加固 1. SDP字段校验(防止参数篡改) 安全SDP生成示例(Node.js): const crypto require(crypto); function signSDP(sdp) { const hmac crypto.createHmac(sha256, SECRET_KEY); hmac.update(sd…...
Git系列之git checkout
git checkout 是 Git 中最常用的命令之一,主要用于切换分支、恢复文件或检出特定提交。以下是关于 git checkout 的所有指令、详细解释及实际应用场景的全面说明。 1. 切换分支 1.1 切换到现有分支 git checkout <branch-name>• 作用:切换到指定…...
IDEA(十一)调整新版本的工具栏显示Git操作(pull、commit、push、revert等)
目录 一、背景二、操作步骤2.1 开启新 UI 样式2.2 设置 Tool Window 工具栏 一、背景 好久没有更新 IDEA 了,更新之后发现 IDEA 的工具栏消失了。一番操作之后,终于把 IDEA 的工具栏的设置调整好了,在此进行记录调整步骤,供大家学…...
C++编程:进阶阶段—4.2对象
目录 4.2 对象特征 4.2.1 构造函数和析构函数 4.2.2 构造函数的分类 4.2.3 拷贝函数调用时机 4.2.4 构造函数调用规则 4.2.5 深拷贝与浅拷贝 4.2.6 初始化列表 4.2.7 类对象作为类成员 4.2.8 静态成员 4.2.9 成员变量和成员函数的存储 4.2.10 this指针 4.2.11 空指针…...
决策树的核心思想
一、决策树的核心思想 本质:通过特征判断对数据集递归划分,形成树形结构。目标:生成一组“若-则”规则,使数据划分到叶子节点时尽可能纯净。关键流程: 特征选择:选择最佳分裂特征(如信息增益最…...
TensorFlow.js 全面解析:在浏览器中构建机器学习应用
TensorFlow.js 全面解析:在浏览器中构建机器学习应用 前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,可以分享一下给大家。点击跳转到网站。 https://www.captainbed.cn/ccc 文章目录 TensorFlow.js 全面解析&#x…...
CI/CD—Jenkins配置Poll SCM触发自动构建
Poll SCM简介 在 Jenkins 等持续集成工具中,“Poll SCM” 是一种用于轮询软件配置管理(SCM)系统以检查代码变更的机制,以下是对它的详细介绍: 作用 “Poll SCM” 允许 Jenkins 定期检查指定的 SCM 系统(如 …...
《云原生技术:DeepSeek分布式推理的效能倍增器》
在当今人工智能飞速发展的时代,大语言模型的推理能力成为了衡量其性能的关键指标。DeepSeek作为人工智能领域的重要参与者,致力于提升模型的推理效率和准确性。而云原生技术的出现,为DeepSeek实现更高效的分布式推理提供了强大的支持。 云原…...
AI与SEO关键词智能解析
内容概要 人工智能技术正重塑搜索引擎优化的底层逻辑,其核心突破体现在关键词解析维度的结构性升级。通过机器学习算法对海量搜索数据的动态学习,AI不仅能够识别传统TF-IDF模型中的高频词汇,更能捕捉语义网络中隐含的关联特征。下表展示了传…...
OpenHarmony子系统开发 -- 构建系统编码规范与最佳实践
OpenHarmony子系统开发 -- 构建系统编码规范与最佳实践 概述 gn是generate ninja的缩写,它是一个元编译系统(meta-build system),是ninja的前端,gn和ninja结合起来,完成OpenHarmony操作系统的编译任务。 gn简介 目…...
1-002:MySQL InnoDB引擎中的聚簇索引和非聚簇索引有什么区别?
在 MySQL InnoDB 存储引擎 中,索引主要分为 聚簇索引(Clustered Index) 和 非聚簇索引(Secondary Index)。它们的主要区别如下: 1. 聚簇索引(Clustered Index) 定义 聚簇索引是表数…...
STM32之BKP
VBAT备用电源。接的时候和主电源共地,正极接在一起,中间连接一个100nf的电容。BKP是RAM存储器。 四组VDD都要接到3.3V的电源上,要使用备用电池,就把电池正极接到VBAT,负极跟主电源共地。 TEMPER引脚先加一个默认的上拉…...
c++的基础排序算法
一、快速排序 1. 选择基准值(Pivot) 作用 :从数组中选择一个元素作为基准(Pivot),用于划分数组。常见选择方式 : 固定选择最后一个元素(如示例代码)。随机选择…...
基于Spring3的抽奖系统
注:项目git仓库地址:demo.lottery 小五Z/Spring items - 码云 - 开源中国 目录 注:项目git仓库地址:demo.lottery 小五Z/Spring items - 码云 - 开源中国 项目具体代码可参考仓库源码,本文只讲解重点代码逻辑 一…...
基于qiime2的16S数据分析全流程:从导入数据到下游分析一条龙
目录 创建metadata 把数据导入qiime2 去除引物序列 双端合并 (dada2不需要) 质控 (dada2不需要) 使用deblur获得特征序列 使用dada2生成代表序列与特征表 物种鉴定 可视化物种鉴定结果 构建进化树(ITS一般不构建进化树…...
【Linux系统编程】基本IO函数
目录 1、open 函数2、create 函数3、write 函数4、read 函数5、lseek 函数6、access 函数7、unlink 函数8、remove 函数9、fcntl 函数写锁互斥锁示例读锁共享锁示例 1、open 函数 头文件 #include<sys/types.h> #include<sys/stat.h>#include<fcntl.h>…...
Deepseek应用技巧-chatbox搭建前端问答
目标:书接上回,由于本地私有化部署了deepseek的大模型,那怎么能够投入生产呢,那就必须有一个前端的应用界面,好在已经有很多的前人已经帮我们把前段应用给搭建好了,我们使用就可以啦,今天我们就…...
OpenAI API模型ChatGPT各模型功能对比,o1、o1Pro、GPT-4o、GPT-4.5调用次数限制附ChatGPT订阅教程
本文包含OpenAI API模型对比页面以及ChatGPT各模型功能对比表 - 截至2025最新整理数据:包含模型分类及描述;调用次数限制; 包含模型的类型有: Chat 模型(如 GPT-4o、GPT-4.5、GPT-4)专注于对话,…...
