当前位置:网站首页>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).
边栏推荐
- LeetCode 535(C#)
- LC: string conversion integer (ATOI) + appearance sequence + longest common prefix
- 杰理之测试盒配置声道【篇】
- Business experience in virtual digital human
- The strength index of specialized and new software development enterprises was released, and Kirin Xin'an was honored on the list
- LeetCode 515(C#)
- 博睿数据入选《2022爱分析 · IT运维厂商全景报告》
- Empowering smart power construction | Kirin Xin'an high availability cluster management system to ensure the continuity of users' key businesses
- Numpy——axis
- 关于ssh登录时卡顿30s左右的问题调试处理
猜你喜欢
648. 单词替换
The strength index of specialized and new software development enterprises was released, and Kirin Xin'an was honored on the list
# 欢迎使用Markdown编辑器
PMP對工作有益嗎?怎麼選擇靠譜平臺讓備考更省心省力!!!
【RT-Thread env 工具安装】
Install mysql8 for Linux X ultra detailed graphic tutorial
让这个 CRMEB 单商户微信商城系统火起来,太好用了!
Seize Jay Chou
2022.07.02
Kirin Xin'an cloud platform is newly upgraded!
随机推荐
杰理之快速配对,不支持取消配对【篇】
超分辨率技术在实时音视频领域的研究与实践
2022.07.02
Longest common prefix (leetcode question 14)
what‘s the meaning of inference
Netease Yunxin participated in the preparation of the standard "real time audio and video service (RTC) basic capability requirements and evaluation methods" issued by the Chinese Academy of Communica
谷歌seo外链Backlinks研究工具推荐
杰理之关于 TWS 配对方式配置【篇】
what‘s the meaning of inference
el-upload上传组件的动态添加;el-upload动态上传文件;el-upload区分文件是哪个组件上传的。
L1-019 who falls first (Lua)
Jerry's headphones with the same channel are not allowed to pair [article]
网信办公布《数据出境安全评估办法》,9 月 1 日起施行
歌单11111
how to prove compiler‘s correctness
Numpy——2. Shape of array
2022.07.05
杰理之开机自动配对【篇】
Teach your sister to write the message queue hand in hand
多个kubernetes集群如何实现共享同一个存储