当前位置:网站首页>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).
边栏推荐
- 反爬虫的重点:识别爬虫
- Empowering smart power construction | Kirin Xin'an high availability cluster management system to ensure the continuity of users' key businesses
- Number - number (Lua)
- L1-023 output gplt (Lua)
- Is AI more fair than people in the distribution of wealth? Research on multiplayer game from deepmind
- 2022.07.02
- PMP每日一练 | 考试不迷路-7.7
- R语言使用ggplot2函数可视化需要构建泊松回归模型的计数目标变量的直方图分布并分析构建泊松回归模型的可行性
- 博睿数据入选《2022爱分析 · IT运维厂商全景报告》
- Draw squares with Obama (Lua)
猜你喜欢

# 欢迎使用Markdown编辑器

Experiment 1 of Compilation Principle: automatic implementation of lexical analyzer (Lex lexical analysis)

Is PMP beneficial to work? How to choose a reliable platform to make it easier to prepare for the exam!!!

2022.07.05
![[tpm2.0 principle and Application guide] Chapter 9, 10 and 11](/img/7f/0d4d91142bc3d79ea445a8f64afba7.png)
[tpm2.0 principle and Application guide] Chapter 9, 10 and 11

杰理之关于 TWS 声道配置【篇】

cmd命令进入MySQL时报服务名或者命令错误(傻瓜式教学)

2022.07.02

Tips and tricks of image segmentation summarized from 39 Kabul competitions

编译原理 实验一:词法分析器的自动实现(Lex词法分析)
随机推荐
Micro service remote debug, nocalhost + rainbow micro service development second bullet
R语言使用ggplot2函数可视化需要构建泊松回归模型的计数目标变量的直方图分布并分析构建泊松回归模型的可行性
2022.07.05
Le PGR est - il utile au travail? Comment choisir une plate - forme fiable pour économiser le cœur et la main - d'œuvre lors de la préparation de l'examen!!!
关于ssh登录时卡顿30s左右的问题调试处理
[tpm2.0 principle and Application guide] Chapter 16, 17 and 18
杰理之手动配对方式【篇】
Command mode - unity
Longest common prefix (leetcode question 14)
LeetCode 535(C#)
Is PMP beneficial to work? How to choose a reliable platform to make it easier to prepare for the exam!!!
Flipping game (enumeration)
项目经理『面试八问』,看了等于会了
2022.07.02
Kirin Xin'an joins Ningxia commercial cipher Association
Kunpeng developer summit 2022 | Kirin Xin'an and Kunpeng jointly build a new ecosystem of computing industry
How to share the same storage among multiple kubernetes clusters
MySQL、sqlserver oracle数据库连接方式
Specify the version of OpenCV non-standard installation
解决rosdep的报错问题