当前位置:网站首页>NPM, YRAN, NPX的差异与关系
NPM, YRAN, NPX的差异与关系
2022-07-28 05:18:00 【SheepOnTheCloud】
| 区别 | npm | yran | |
| 安装方式 | 需等待上一个安装任务结束才会执行下一个 | 同时执行多个安装任务 | |
| 离线安装 | 从网络上重新下载 | 如果已经安装过包,会优先从中获取 | |
| 版本 | 默认从网络下载最新的最稳定的,可以通过命令实现版本锁定 | 默认有一个 yarn.lock 文件锁定版本,保证环境统一 | |
| 安装输出 | 输出信息冗余 | 输出的信息较少 | |
| 下载安装 | 在 node.js 官网里推荐选择 LTS (长期支持)版本 | npm install -g yarn | |
| 查看版本 | 命令行用node -v 查看node的安装版本。顺便 npm -v 查看npm的版本号。 | yarn --version |
总结
1,npm 下载速度慢,即使重新install是速度依旧慢,yarn要快
2,npm的同一个项目安装的包无法保持一致性,yarn版本锁定
3,npm下载多个包时单个包的下载出错会抛出并继续下载下一个包,yran直观的打印安装信息
npx?
npx是npm的高级版本,具有更强大的功能
- 在项目中直接运行指令,直接运行node_modules中的某个指令,不需要输入文件路径
node-modules/.bin/babel.js --version npx babel --version - 避免全局安装模块:npx 临时安装一个模块,使用过后删除这个模块(下面的两个模块不需要全局安装)
npx babel my-react-app npx [email protected] main.js -o ./dist/main.js - 使用不同版本的命令,使用本地或者下载的命令
npx --no-install http-server # 必须使用本地 http-server(本地没有就报错) npx --ignore-existing create-react-app my-react-app # 忽略本地安装的包,直接使用下载的包 npx [email protected] -v #使用特定版本的包的命令参数
- -p 下载某个模块后,运行命令(命令必须在下载后才行,类似于通道符)
npx -p [email protected] node -v npx -p A -p B [command]github
- 可以执行仓库中的代码,远程代码必须是一个模块,即必须包含
package.json和入口脚本npx github:piuccio/cowsay hello
边栏推荐
- Feignclient calls the get method and reports an error resultvo{result= unknown exception. Exception details: request method 'post' not supported
- Video twins: the starting point of informatization upgrading of smart Parks
- openjudge:找出全部子串位置
- repackag failed: Unable to find main class
- Pytorch uses hook to get feature map
- ResNet结构对比
- Openjudge: count the number of numeric characters
- C语言回顾(字节对齐篇)
- Review of metallurgical physical chemistry ---- gas solid reaction kinetics
- 集合框架的操作使用
猜你喜欢

Advanced multi threading: the underlying principle of synchronized, the process of lock optimization and lock upgrade

GD32F407 移植FreeRTOS+Lwip

Delete specific elements in order table OJ

Sequence table OJ topic

Review of metallurgical physical chemistry --- liquid liquid reaction kinetics

蒙特卡罗方法求解圆周率π并用turtle画点,以及完成进度条问题

分支与循环语句

Writing methods of scientific research papers: add analysis and discussion in the method part to explain their contributions and differences

repackag failed: Unable to find main class

函数基础知识以及特殊点
随机推荐
VMware Workstation is incompatible with device/credential guard. Disable device/credential guard
Advanced multithreading: Lock strategy
链表中关于快慢指针的oj题
openjudge:校园食宿预订系统
冶金物理化学复习 --- 复杂反应的速率方程
Mybats foreach multi select query, index loop, and cancel the and/or tag
softmax多分类 梯度推导
[MySQL] solve the problem of MySQL time zone and 8-hour difference in database time
The Monte Carlo method solves the PI and draws points with turtle, and completes the progress bar problem
树莓派串口
BeanUtils. Copyproperties cannot copy different list sets problem solving lists.transform function
冶金物理化学复习 ---- 气固反应动力学
Openjudge: upper and lower case letters are interchanged
JUC notes
图像增强——MSRCR
Leetcode 随即链表的深拷贝
Video twins: the starting point of informatization upgrading of smart Parks
冶金物理化学复习 --- 金属的电沉积,还原过程
Response < t > class
论文模型主图范例