当前位置:网站首页>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).
边栏推荐
- Zhong Xuegao wants to remain innocent in the world
- Business experience in virtual digital human
- 怎么在手机上买股票开户 股票开户安全吗
- 从39个kaggle竞赛中总结出来的图像分割的Tips和Tricks
- # 欢迎使用Markdown编辑器
- Numpy——2.数组的形状
- 【牛客网刷题系列 之 Verilog进阶挑战】~ 多bit MUX同步器
- CMD command enters MySQL times service name or command error (fool teaching)
- how to prove compiler‘s correctness
- 杰理之关于 TWS 配对方式配置【篇】
猜你喜欢

2022.07.05

杰理之测试盒配置声道【篇】

ES6 note 1

Research and practice of super-resolution technology in the field of real-time audio and video

网易云信参与中国信通院《实时音视频服务(RTC)基础能力要求及评估方法》标准编制...

2022如何评估与选择低代码开发平台?

How to share the same storage among multiple kubernetes clusters

Tapdata 的 2.0 版 ,开源的 Live Data Platform 现已发布

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

Former richest man, addicted to farming
随机推荐
实训九 网络服务的基本配置
Tapdata 的 2.0 版 ,开源的 Live Data Platform 现已发布
Flipping game (enumeration)
LeetCode 648(C#)
2022.07.04
LeetCode1051(C#)
UCloud是基础云计算服务提供商
AD域组策略管理
杰理之关于 TWS 声道配置【篇】
R语言fpc包的dbscan函数对数据进行密度聚类分析、查看所有样本的聚类标签、table函数计算聚类簇标签与实际标签构成的二维列联表
R语言使用ggplot2函数可视化需要构建泊松回归模型的计数目标变量的直方图分布并分析构建泊松回归模型的可行性
R语言ggplot2可视化:使用ggpubr包的ggstripchart函数可视化分组点状条带图(dot strip plot)、设置position参数配置不同分组数据点的分离程度
L1-023 output gplt (Lua)
Command mode - unity
多个kubernetes集群如何实现共享同一个存储
谷歌seo外链Backlinks研究工具推荐
项目经理『面试八问』,看了等于会了
Version 2.0 of tapdata, the open source live data platform, has been released
Chief technology officer of Pasqual: analog quantum computing takes the lead in bringing quantum advantages to industry
Kirin Xin'an won the bid for the new generation dispatching project of State Grid!