当前位置:网站首页>npm ---- install yarn
npm ---- install yarn
2022-08-02 06:45:00 【m0_67392931】
NPM ---- install yarn
The premise of installing
yarnis thatnpmneeds to be installed first, and the environment variables are configured before it can be used.
1. Download and install
npm install yarn -gCheck the version after installation is complete:
yarn --version // 1.22.17Second, 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 -gCheck source:
yarn config get registry // https://registry.npm.taobao.orgyarn config get sass_binary_site // http://cdn.npm.taobao.org/dist/node-sassThree, the advantages of Yarn
yarn is a npm package management tool released by Facebook, which I personally feel very comfortable to use:
- Security
Yarnalgorithmically checks the integrity of each package before executing code. - Fast speed
Yarncaches 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.Andnpmwill 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.jsonLet 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
边栏推荐
猜你喜欢
随机推荐
51 MCU peripherals: ADC
Common functions of pytorch
Luogu mini game Daquan (everyone who uses Luogu must know)
nacos安装配置和单机部署教程
Integrate ssm (1)
leetcode一步解决链表合并问题
Thread Basics (1)
eggjs controller层调用controller层解决方案
C竞赛训练
ATM系统
How to perform concurrent calculation (stability test and stress test)?
Nacos注册中心的部署与用法详细介绍
51 microcontroller peripherals article: dot-matrix LCD
反向解析dns服务器
pl/sql之神奇的嵌套与变量生命周期
APP Bluetooth connection test of test technology
分布式文件存储服务器之Minio对象存储技术参考指南
Different ways of shell scripting
What are the ways to improve software testing capabilities?After reading this article, it will take you up a notch
Not annotated parameter overrides @NonNullApi parameter









