当前位置:网站首页>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开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担。添加下方名片,即可获取全套学习资料哦
边栏推荐
- About the directory structure of the web application
- MySQL数据表的基本操作和基于 MySQL数据表的基本操作的综合实例项目
- 51单片机外设篇:点阵式LCD
- Packaging and deployment of go projects
- 18 years of programmer career, read more than 200 programming books, pick out some essence to share with you
- Linux CentOS8安装Redis6
- Shuttle + Alluxio 加速内存Shuffle起飞
- Different ways of shell scripting
- 自动化运维工具——ansible、概述、安装、模块介绍
- 机器学习——支持向量机原理
猜你喜欢

Guarantee WIFI security in home and enterprise-with AC and AP networking experiment

Linux CentOS8安装Redis6

测试环境要多少?从成本与效率说起

上海交大牵手淘宝成立媒体计算实验室:推动视频超分等关键技术发展

The virtual reality real estate display system foresees the future decoration effect in advance

Meta公司内部项目-RaptorX:将Presto性能提升10倍

Double for loop case (use js jiujiu printing multiplication table)

字节面试题:如何保证缓存和数据库的一致性

在腾讯做外包测试的那些日子.....

淘系资深工程师整理的300+项学习资源清单(2021最新版)
随机推荐
Difference and analysis of CPU usage and load
上海交大牵手淘宝成立媒体计算实验室:推动视频超分等关键技术发展
PSQL function, predicate, CASE expression and set operations
51单片机外设篇:ADC
What is the most important ability of a programmer?
PIL与numpy格式之间的转换
Common functions of pytorch
Important concepts of target detection - IOU, receptive field, hole convolution, mAP
线程基础(一)
6W+字记录实验全过程 | 探索Alluxio经济化数据存储策略
DNS的解析流程
如何进行并发数计算(稳定性测试和压力测试)?
面试官:设计“抖音”直播功能测试用例吧
家用 NAS 服务器(4)| MergerFS和SnapRaid数据定时备份
There are more and more talents in software testing. Why are people still reluctant to take the road of software testing?
Shuttle + Alluxio 加速内存Shuffle起飞
go里面的基本知识
Redis(十二) - Redis消息队列
Meta公司新探索 | 利用Alluxio数据缓存降低Presto延迟
What are the ways to improve software testing capabilities?After reading this article, it will take you up a notch