当前位置:网站首页>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).
边栏推荐
- Kirin Xin'an won the bid for the new generation dispatching project of State Grid!
- 2022如何评估与选择低代码开发平台?
- 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
- Redis master-slave and sentinel master-slave switchover are built step by step
- MySQL、sqlserver oracle数据库连接方式
- 最长公共前缀(leetcode题14)
- 杰理之开机自动配对【篇】
- Key points of anti reptile: identifying reptiles
- IP 工具类
- Seize Jay Chou
猜你喜欢

The strength index of specialized and new software development enterprises was released, and Kirin Xin'an was honored on the list

el-upload上传组件的动态添加;el-upload动态上传文件;el-upload区分文件是哪个组件上传的。

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

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

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

Zhong Xuegao wants to remain innocent in the world

【RT-Thread env 工具安装】

索引总结(突击版本)

杰理之关于 TWS 配对方式配置【篇】

ES6笔记一
随机推荐
[mime notes]
9 原子操作类之18罗汉增强
Longest common prefix (leetcode question 14)
Hongmeng smart home [1.0]
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
吞吐量Throughout
凌云出海记 | 赛盒&华为云:共助跨境电商行业可持续发展
解决rosdep的报错问题
怎么在手机上买股票开户 股票开户安全吗
Initial experience of cache and ehcache "suggestions collection"
ant desgin 多选
杰理之快速配对,不支持取消配对【篇】
MySQL、sqlserver oracle数据库连接方式
Big Ben (Lua)
L1-027 rental (Lua)
[tpm2.0 principle and Application guide] Chapter 16, 17 and 18
Uvalive – 4621 CAV greed + analysis "suggestions collection"
杰理之关于 TWS 声道配置【篇】
网信办公布《数据出境安全评估办法》,9 月 1 日起施行
从39个kaggle竞赛中总结出来的图像分割的Tips和Tricks