当前位置:网站首页>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
边栏推荐
- When using \hl for highlighting, latex always reports an error when encountering a reference, showing that there are fewer or more parentheses
- FusionGAN代码学习(一)
- Openjudge: find the first character that appears only once
- Lamda gets the current number of cycles, atomicinteger
- 树莓派串口配置
- Low illumination image data set
- openjudge:大小写字母互换
- 科研论文写作方法:在方法部分添加分析和讨论说明自己的贡献和不同
- SSM project quick build project configuration file
- Digital twin technology creates visual application of smart mine
猜你喜欢

regular expression

框架一步一步方便使用的流程

c语言:通过一个例子来认识函数栈帧的创建和销毁讲解

顺序表oj之删除特定的元素

Example of main diagram of paper model

Arrangement of main drawings of the latest 54 papers of eccv22

对极大似然估计、梯度下降、线性回归、逻辑回归的理解

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

latex和word之间相互转换

You must configure either the server or JDBC driver (via the ‘serverTimezone)
随机推荐
openjudge:大小写字母互换
低照度图像数据集
Openjudge: find all substring positions
openjudge:病人排队
openjudge:万年历
GD32F407 移植FreeRTOS+Lwip
c语言:通过一个例子来认识函数栈帧的创建和销毁讲解
How Visio can quickly generate the same pattern and image matrix
openjudge:找出全部子串位置
NRF51822 回顾总结
树莓派串口
Redis' bloom filter
When using \hl for highlighting, latex always reports an error when encountering a reference, showing that there are fewer or more parentheses
openjudge:找第一个只出现一次的字符
冶金物理化学复习 -- 金属电沉积过程中的阴极极化,超电势以及阳极和阳极过程
图像增强评价指标学习之——结构相似性SSIM
Centos7 install MySQL 5.7
Merge two ordered arrays of order table OJ
蒸馏模型图
环形链表问题