当前位置:网站首页>A pot of stew, a collection of common commands of NPM and yarn cnpm
A pot of stew, a collection of common commands of NPM and yarn cnpm
2022-07-07 19:39:00 【Milo_】
1. Configure the mirror
npmmirror China mirror station
npm config get registry // see npm Current mirror source
npm config set registryhttps://registry.npmmirror.com/ // Set up npm The image source is Taobao image
yarn config get registry // see yarn Current mirror source
yarn config set registry https://registry.npmmirror.com/ // Set up yarn The image source is Taobao image
2. Dependent installation
2.1 npm&cnpm
npm install xxx It is also abbreviated as npm i xxx This is the most common way to download , It will install the package in the current directory node_modelus in
npm install [email protected]1.x.x It can be accurately installed to a certain version
npm install --save xxx It is also abbreviated as npm install -s xxx This method will write the downloaded module information to package.json Medium dependencies In the list
npm install --save-dev xxx It is also abbreviated as npn install -D xxx This method will write the downloaded module information to package.json Medium devDependencies In the list Compared with the second method dependencies Is a runtime dependency , and devDependencies It's a development dependency . in other words , use --save-dev The installed package will not be used after we release it , Only used in development
npm install -g xxx The module will be installed to the global , That is, under the global path configured above
Use npm uninstall xxx or npm uninstall -g xxx Uninstallable module , If all uninstalls, use npm uninstall -all
2.2 yarn
yarn add package-name Installation package “ newest ” edition .
yarn add package-[email protected]1.2.3 Install a specific version of the package from the registry .
yarn add package-[email protected] Install specific “ label ”( for example beta、next or latest).
边栏推荐
- ant desgin 多选
- LC: string conversion integer (ATOI) + appearance sequence + longest common prefix
- 2022.07.02
- tp6 实现佣金排行榜
- [tpm2.0 principle and Application guide] Chapter 16, 17 and 18
- 反爬虫的重点:识别爬虫
- How to share the same storage among multiple kubernetes clusters
- 超分辨率技术在实时音视频领域的研究与实践
- L1-025 positive integer a+b (Lua)
- R语言ggplot2可视化:使用ggpubr包的ggviolin函数可视化小提琴图、设置palette参数自定义不同水平小提琴图的填充色、add参数在小提琴图添加箱图
猜你喜欢

Redis master-slave and sentinel master-slave switchover are built step by step

PV静态创建和动态创建

Numpy——axis

一张图深入的理解FP/FN/Precision/Recall

PV static creation and dynamic creation

648. 单词替换

Micro service remote debug, nocalhost + rainbow micro service development second bullet

网易云信参与中国信通院《实时音视频服务(RTC)基础能力要求及评估方法》标准编制...
让这个 CRMEB 单商户微信商城系统火起来,太好用了!
![[tpm2.0 principle and Application guide] Chapter 16, 17 and 18](/img/7a/b16549590e6445d9199c8000d47d36.png)
[tpm2.0 principle and Application guide] Chapter 16, 17 and 18
随机推荐
2022.07.05
Make insurance more "safe"! Kirin Xin'an one cloud multi-core cloud desktop won the bid of China Life Insurance, helping the innovation and development of financial and insurance information technolog
银行理财产品怎么买?需要办银行卡吗?
[Base64 notes] [suggestions collection]
9 原子操作类之18罗汉增强
R语言fpc包的dbscan函数对数据进行密度聚类分析、查看所有样本的聚类标签、table函数计算聚类簇标签与实际标签构成的二维列联表
Numpy——axis
PV静态创建和动态创建
LeetCode 535(C#)
R语言ggplot2可视化:使用ggpubr包的ggqqplot函数可视化QQ图(Quantile-Quantile plot)
浏览积分设置的目的
# 欢迎使用Markdown编辑器
一锅乱炖,npm、yarn cnpm常用命令合集
L1-028 judging prime number (Lua)
R语言ggplot2可视化:使用ggpubr包的ggstripchart函数可视化分组点状条带图(dot strip plot)、设置position参数配置不同分组数据点的分离程度
2022如何评估与选择低代码开发平台?
歌单11111
Kirin Xin'an with heterogeneous integration cloud financial information and innovation solutions appeared at the 15th Hunan Financial Technology Exchange Conference
Unable to link the remote redis server (solution 100%
PMP对工作有益吗?怎么选择靠谱平台让备考更省心省力!!!