当前位置:网站首页>nvm、nrm、npx使用(安装、基本命令、参数、curl、wget)
nvm、nrm、npx使用(安装、基本命令、参数、curl、wget)
2022-06-30 09:52:00 【YF-SOD】
目录
npx https://gist.github.com/zkat/4bc19503fe9e9309e2bfaa2c58074d32
nvm
nodejs版本管理工具
安装
nvm 安装与使用(详细步骤)_卡尔特斯的博客-CSDN博客_nvm安装
相关软件
curl
用来请求 Web 服务器。linux下自带的。
wget
网络上进行下载的简单而强大的自由软件,linux下自带的。
基本命令
nvm ls
显示已安装的node版本。

nvm ls-remote
列出所有可安装的版本
nvm use 14.19.0
更改当前终端进程node使用的版本号,注意更改的只是当前终端进程的node使用版本,新建或切换其它终端时,版本没有变化。使用下面命令更改默认的版本。
nvm alias default 14.19.0
更改默认(所有终端进程)的node使用的版本号。
nvm install 14.19.0
安装node版本。安装后会自动执行nvm use安装的版本
nvm uninstall 14.19.0
删除node版本14.19.0。注意nvm 默认是不能删除被设定为 default 版本的 node,特别是只安装了一个 node 的时候,这个时候我们需要切换默认版本(nvm alias default),然后再删除。
nvm current
和node -v相同,查看当前终端进程使用的node版本。
nvm deactivate
解除当前版本绑定(将当前终端进程使用的版本指向系统版本)。

nvm on
打开对node版本的控制。
nvm off
关闭对node版本的控制。
nvm使用手册
https://github.com/nvm-sh/nvm/blob/master/README.md
nrm
npm仓库源管理工具
安装
npm i -g nrm
基本命令
nrm ls
查看当前npm的源,下图表示当前npm源为taobao的源。

nrm use npm
切换npm的源为上图npm对应的链接。
nrm test
显示各个仓库的测速,越小越快。

npx
npm5.2之后引入的(自带),所以npm版本大于5.2的可以直接使用 npx 命令而不用安装。
手动安装
npm install -g npx作用
1.调用项目内部安装的模块
2.避免全局安装
3.执行 GitHub 源码
npx mocha --version
首先会检查项目内部是否安装了mocha模块,安装了的话则调用项目内部安装的模块mocha(通常直接调用项目内安装的模块需要在项目的根目录下执行node-modules/.bin/mocha --version)
当未安装时,npx 将mocha模块下载到一个临时目录,使用以后再删除。以后再次执行上面的命令,会重新下载mocha。
npx https://gist.github.com/zkat/4bc19503fe9e9309e2bfaa2c58074d32npx https://gist.github.com/zkat/4bc19503fe9e9309e2bfaa2c58074d32
执行Gist代码。远程代码必须是一个模块,即必须包含package.json和入口脚本。
参数
--no-install
npx 强制使用本地模块,不下载远程模块,本地没有就会报错
--ignore-existing
npx 强制使用远程模块,本地有也会使用远程的。
-p
npx -p node@12.22.12 node -v,指定版本安装运行。
-c
将所有命令都用 npx 解释。详细见使用教程。
使用教程
边栏推荐
- MySQL log management, backup and recovery of databases (1)
- Using LVM to resize partitions
- ArcGIS Pro scripting tool (5) - delete duplicates after sorting
- Enter the world of helium (hNT) hotspot servers to bring you different benefits
- Gd32 RT thread ota/bootloader driver function
- 记一次实习的经历,趟坑必备(一)
- [ark UI] implementation of the startup page of harmoniyos ETS
- Yixian e-commerce released its first quarterly report: adhere to R & D and brand investment to achieve sustainable and high-quality development
- Skill sorting [email protected]+ Alibaba cloud +nbiot+dht11+bh1750+ soil moisture sensor +oled
- 孙安民作品《莲花净心》数字藏品上线长城数艺
猜你喜欢

GeoffreyHinton:我的五十年深度学习生涯与研究心法

Remember the experience of an internship. It is necessary to go to the pit (I)

华南产业集团发力数字经济,城链科技发布会成功召开

Using LVM to resize partitions

The latest SCI impact factor release: the highest score of domestic journals is 46! Netizen: I understand if

IPhone address book import into Excel

I found a wave of "alchemy artifact" in the goose factory. The developer should pack it quickly

Yixian e-commerce released its first quarterly report: adhere to R & D and brand investment to achieve sustainable and high-quality development

安徽《合肥市装配式建筑施工图审查设计深度要求》印发;河北衡水市调整装配式建筑预售许可标准

【深度学习】深度学习检测小目标常用方法
随机推荐
CVPR 2022 | Tsinghua & bytek & JD put forward BRT: Bridging Transformer for vision and point cloud 3D target detection
Gd32 RT thread flash driver function
GD32 RT-Thread RTC驱动函数
Leetcode question brushing (III) -- binary search (go Implementation)
ArcGIS Pro scripting tool (5) - delete duplicates after sorting
技能梳理[email protected]基于51系列单片机的智能仪器教具
Getting started with X86 - take over bare metal control
前嗅ForeSpider教程:抽取数据
我在鹅厂淘到了一波“炼丹神器”,开发者快打包
MIT-6874-Deep Learning in the Life Sciences Week5
Curl --- the request fails when the post request parameter is too long (more than 1024b)
The digital collection of sunanmin's lotus heart clearing was launched on the Great Wall Digital Art
Enter the world of helium (hNT) hotspot servers to bring you different benefits
Skill sorting [email protected]+ Alibaba cloud +nbiot+dht11+bh1750+ soil moisture sensor +oled
从0使用keil5软件仿真调试GD32F305
【深度学习】深度学习检测小目标常用方法
L'activité "Kunming City coffee map" a rouvert
Criu enables hot migration
“昆明城市咖啡地图”活动再度开启
MIT-6874-Deep Learning in the Life Sciences Week6