当前位置:网站首页>NPM ---- 安装yarn
NPM ---- 安装yarn
2022-08-02 05:18:00 【m0_67392931】
NPM ---- 安装yarn
安装
yarn的前提是需要先安装好npm,且环境变量都配置好了,才可以使用。
一、下载安装
npm install yarn -g
安装完成之后检查版本:
yarn --version // 1.22.17
二、配置Yarn
配置源:
yarn config set registry https://registry.npm.taobao.org -g
yarn config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass -g
检查源:
yarn config get registry // https://registry.npm.taobao.org
yarn config get sass_binary_site // http://cdn.npm.taobao.org/dist/node-sass
三、Yarn的优点
yarn是Facebook发布的一款npm包管理工具,个人感觉使用起来非常舒服:
- 安全
在执行代码之前,Yarn会通过算法校验每个安装包的完整性。 - 速度快
Yarn缓存了每个下载过的包,所以再次使用时无需重复下载。 同时利用并行下载以最大化资源利用率,因此安装速度更快。 - 可靠
由于yarn.lock存在的机制,项目中的依赖的版本会被锁定,不用担心协同开发过程中出现版本不一致的问题。而npm永远都会给你下载最新的依赖版本,非常的狗血。
四、一些常用的Yarn命令
yarn init // 生成package.json文件
yarn install // 安装yarn.lock的所有依赖
yarn install --force // 重新安装依赖
yarn remove moduleName // 删除依赖
yarn add moduleName // 安装某个依赖
yarn add moduleName --dev/-D // 安装到开发环境
yarn run scriptName // 执行package.json命名的脚本命令
先自我介绍一下,小编13年上师交大毕业,曾经在小公司待过,去过华为OPPO等大厂,18年进入阿里,直到现在。深知大多数初中级java工程师,想要升技能,往往是需要自己摸索成长或是报班学习,但对于培训机构动则近万元的学费,着实压力不小。自己不成体系的自学效率很低又漫长,而且容易碰到天花板技术停止不前。因此我收集了一份《java开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担。添加下方名片,即可获取全套学习资料哦
边栏推荐
- coredns介绍
- 25K test old bird's 6-year experience in interviews, four types of companies, four types of questions...
- Cyber Security Learning - Intranet Penetration 4
- Guarantee WIFI security in home and enterprise-with AC and AP networking experiment
- How to perform concurrent calculation (stability test and stress test)?
- Detailed explanation of interface in Go language
- Difference and analysis of CPU usage and load
- 测试技术之APP蓝牙连接测试
- 为什么4个字节的float要比8个字节的long大呢?
- 国际顶会OSDI首度收录淘宝系统论文,端云协同智能获大会主旨演讲推荐
猜你喜欢

Point Density-Aware Voxels for LiDAR 3D Object Detection 论文笔记

What is the most important ability of a programmer?

Different ways of shell scripting

BGP实验(路由反射器,联邦,路由优化)

selenium + robotframework的运行原理

Alluxio为Presto赋能跨云的自助服务能力

rhce作业

C语言操作符详解(2)

Polar Parametrization for Vision-based Surround-View 3D Detection Paper Notes

leetcode括号匹配问题——32.最长有效括号
随机推荐
LeetCode brush topic series - 787 K station transfer within the cheapest flight
C 竞赛——捕鱼
51单片机外设篇:红外通信
classSR论文阅读笔记
C竞赛训练
leetcode-318.最大单词长度乘积
TikTok平台的两种账户有什么区别?
Say good woman programmers do testing have an advantage?More than a dozen interview, abuse of cry ~ ~ by the interviewer
Redis集群模式
OAuth 授权协议 | 都云原生时代了,我们应该多懂一点OAuth ?
Deep learning - CNN realizes the recognition of MNIST handwritten digits
Features and installation of non-relational database MongoDB
go里面的基本知识
Polar Parametrization for Vision-based Surround-View 3D Detection Paper Notes
程序员写PPT的小技巧
点云旋转到参考坐标系方向(最小方向包围盒方法)
21 Day Learning Challenge Schedule
路由规划中级篇
PIL与numpy格式之间的转换
双重for循环案例(用js打印九九乘法表)