当前位置:网站首页>npm ---- install yarn
npm ---- install yarn
2022-08-02 06:45:00 【m0_67392931】
NPM ---- install yarn
The premise of installing
yarn
is thatnpm
needs to be installed first, and the environment variables are configured before it can be used.
1. Download and install
npm install yarn -g
Check the version after installation is complete:
yarn --version // 1.22.17
Second, configure Yarn
Configuration Source:
yarn config set registry https://registry.npm.taobao.org -gyarn config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass -g
Check source:
yarn config get registry // https://registry.npm.taobao.orgyarn config get sass_binary_site // http://cdn.npm.taobao.org/dist/node-sass
Three, the advantages of Yarn
yarn
is a npm
package management tool released by Facebook, which I personally feel very comfortable to use:
- Security
Yarn
algorithmically checks the integrity of each package before executing code. - Fast speed
Yarn
caches every downloaded package, so you don't need to download it again when you use it again.Also takes advantage of parallel downloads to maximize resource utilization, so installations are faster. - Reliable
Due to the mechanism ofyarn.lock
, the versions of dependencies in the project will be locked, so there is no need to worry about version inconsistencies during collaborative development.Andnpm
will always download the latest dependency version for you, which is very bloody.
Fourth, some commonly used Yarn commands
yarn init // Generate package.json fileyarn install // Install all dependencies of yarn.lockyarn install --force // reinstall dependenciesyarn remove moduleName // remove dependenciesyarn add moduleName // install a dependencyyarn add moduleName --dev/-D // Install to development environmentyarn run scriptName // Execute the script command named by package.json
Let me introduce myself first. The editor graduated from Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Ali in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is also very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
- 蚂蚁三面:MQ 消息丢失、重复、积压问题,有哪些解决方案?
- Not annotated parameter overrides @NonNullApi parameter
- The international top conference OSDI included Taobao system papers for the first time, and the device-cloud collaborative intelligence was recommended by the keynote speech of the conference
- APP Bluetooth connection test of test technology
- kubernetes affinity, anti-affinity, taint, tolerance
- 卸载redis
- 25K test old bird's 6-year experience in interviews, four types of companies, four types of questions...
- Stress testing and performance analysis of node projects
- 双重for循环案例(用js打印九九乘法表)
- nacos registry
猜你喜欢
随机推荐
如何进行并发数计算(稳定性测试和压力测试)?
[Cartoon] 2021 full score programmer behavior comparison table (latest version)
5款经典代码阅读器的使用方案对比
如何优化OpenSumi终端性能?
Node的安装与环境变量的配置
Shell 脚本不同玩法
Alluxio为Presto赋能跨云的自助服务能力
关于 VS Code 优化启动性能的实践
Smart people's game improvement: Chapter 3, Lesson 2: "Number of Tongtong" (number)
How to perform concurrent calculation (stability test and stress test)?
nacos安装配置和单机部署教程
代码编世界 科技创未来
Features and installation of non-relational database MongoDB
C竞赛训练
Polar Parametrization for Vision-based Surround-View 3D Detection 论文笔记
Meta公司内部项目-RaptorX:将Presto性能提升10倍
pytorch basic operations: classification tasks using neural networks
股价屡创新低 地产SaaS巨头陷入困境 明源云该如何转型自救?
An advanced method for solving palindromes
卸载redis