当前位置:网站首页>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 解释。详细见使用教程。
使用教程
边栏推荐
- 那个程序员,被打了。
- KOREANO ESSENTIAL打造气质职场范
- GD32 RT-Thread DAC驱动函数
- 华南产业集团发力数字经济,城链科技发布会成功召开
- Skill sorting [email protected]+ Alibaba cloud +nbiot+dht11+bh1750+ soil moisture sensor +oled
- MySQL index, transaction and storage engine of database (1)
- Es common curl finishing
- Apple's 5g chip was revealed to have failed in research and development, and the QQ password bug caused heated discussion. Wei Lai responded to the short selling rumors. Today, more big news is here
- Compare the maximum computing power of the Cenozoic top ant s19xp and the existing s19pro in bitland
- Musk has more than 100 million twitter fans, but he has been lost online for a week
猜你喜欢

South China Industrial Group launched digital economy and successfully held the city chain technology conference

Test memory read rate
[email protected] control a dog's running on OLED"/>Skill combing [email protected] control a dog's running on OLED

Dyson design award, changing the world with sustainable design

我在鹅厂淘到了一波“炼丹神器”,开发者快打包

Oracle creates a stored procedure successfully, but the compilation fails

最新SCI影响因子公布:国产期刊最高破46分!网友:算是把IF玩明白了

Criu enables hot migration

今晚19:00知识赋能第2期直播丨OpenHarmony智能家居项目之控制面板界面设计

逸仙電商發布一季報:堅持研發及品牌投入,實現可持續高質量發展
随机推荐
Robotframework learning notes: environment installation and robotframework browser plug-in installation
Configure Yii: display MySQL extension module verification failed
MySQL index, transaction and storage engine of database (1)
Leetcode question brushing (I) -- double pointer (go Implementation)
Foster design method
ArcGIS Pro脚本工具(6)——修复CAD图层数据源
Remember the experience of an internship. It is necessary to go to the pit (I)
How to deploy deflationary combustion destruction contract code in BSC chain_ Deploy dividend and marketing wallet contract code
2022 Season 6 perfect children's model toxon division finals came to a successful conclusion
技能梳理[email protected]在oled上控制一条狗的奔跑
R语言aov函数进行重复测量方差分析(Repeated measures ANOVA、其中一个组内因素和一个组间因素)、分别使用interaction.plot函数和boxplot对交互作用进行可视化
RobotFramework学习笔记:环境安装以及robotframework-browser插件的安装
Questions about cookies and sessions
技能梳理[email protected]+阿里云+nbiot+dht11+bh1750+土壤湿度传感器+oled
光明行动:共同呵护好孩子的眼睛——广西实施光明行动实地考察调研综述
戴森设计大奖,以可持续化设计改变世界
Get through the supply chain Shenzhen gift show helps cross-border e-commerce find ways to break the situation
[AGC] build service 3- authentication service example
“昆明城市咖啡地图”活动再度开启
马斯克推特粉丝过亿了,但他在线失联已一周