当前位置:网站首页>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).
边栏推荐
猜你喜欢
Jerry's headphones with the same channel are not allowed to pair [article]
杰理之相同声道的耳机不允许配对【篇】
Jürgen Schmidhuber回顾LSTM论文等发表25周年:Long Short-Term Memory. All computable metaverses. Hierarchical reinforcement learning (RL). Meta-RL. Abstractions in generative adversarial RL. Soccer learn
2022.07.04
el-upload上传组件的动态添加;el-upload动态上传文件;el-upload区分文件是哪个组件上传的。
PMP每日一练 | 考试不迷路-7.7
ES6 note 1
Seize Jay Chou
一张图深入的理解FP/FN/Precision/Recall
Numpy——axis
随机推荐
How to buy stocks on your mobile phone and open an account? Is it safe to open an account
解决远程rviz报错问题
[tpm2.0 principle and Application guide] Chapter 9, 10 and 11
反爬虫的重点:识别爬虫
Command mode - unity
Solve the error reporting problem of rosdep
Seize Jay Chou
Download from MySQL official website: mysql8 for Linux X Version (Graphic explanation)
【Confluence】JVM内存调整
The research group of the Hunan Organizing Committee of the 24th China Association for science and technology visited Kirin Xin'an
cmd命令进入MySQL时报服务名或者命令错误(傻瓜式教学)
L1-025 positive integer a+b (Lua)
Responsibility chain model - unity
Draw squares with Obama (Lua)
R语言ggplot2可视化:使用ggpubr包的ggqqplot函数可视化QQ图(Quantile-Quantile plot)
Empowering smart power construction | Kirin Xin'an high availability cluster management system to ensure the continuity of users' key businesses
LeetCode 890(C#)
el-upload上传组件的动态添加;el-upload动态上传文件;el-upload区分文件是哪个组件上传的。
LeetCode1051(C#)
how to prove compiler‘s correctness