当前位置:网站首页>NPM operation instruction
NPM operation instruction
2022-07-26 05:05:00 【Spy family】
# npm
npm yes nodejs Package management tools
npm Can support :
1、 Download the package from the server to the local
2、 Upload the local package to the server
3、 Download the software from the server to the local
#### Initialize project
Use `npm init` Command to initialize a project , This command will create a package.json file .
#### Install a package
npm install xxx --save-dev: Install one in development mode xxx My bag
npm install xxx --save: Install one in production mode xxx My bag
among install It can be abbreviated as i --save It can be abbreviated as -S --save-dev It can be abbreviated as -D
Such as installation jquery:
npm i jquery -D
-S Parameters can be omitted , Installed in production mode by default
#### Recover all dependencies
npm install perhaps npm i
#### Uninstall a package
npm unistall xxx uninstall xxx This package
#### Update a package
npm update xxx Update package
#### see npm Mirror source
npm config get registry
#### install nrm
nrm It is a mirror source management tool
npm i nrm -g // Global installation
#### see nrm Image support
nrm ls
#### Toggle mirror
nrm use taobao
# yarn
yarn yes npm An advanced version of however yarn and npm Can't coexist A project uses npm You can't use yarn
#### install yarn
1、 Go to the official website to find the installation package and install it manually
2、 adopt npm install :
npm i yarn -g
#### Initialize project
yarn init
#### Installation package
yarn add xxx Install a package
yarn add [email protected] Specify version installation
yarn add xxx --dev development environment
yarn add xxx --peer Production environment
#### Upgrade package
yarn upgrade xxx Update a package
#### Remove package
yarn remove xxx remove / Uninstall a package
#### Install all dependencies
yarn install yarn
# cnpm
cnpm It was cloned on Taobao npm, Copied a copy with the image of Taobao npm
#### install cnpm
npm i cnpm -g
Operation and of package management npm As like as two peas
For example, the installation package uses :
cnpm i jquery -S
How to put a yarn The management project is changed to npm
1、 Delete yarn.lock
2、 Delete nodemodules Catalog
3、npm install Use npm Recovery projects
边栏推荐
- Tonight! Stonedb is officially open source. Please check this strategy~
- Molecular skeleton transition tool -delinker introduction
- Ansible tutorial
- 你对“happen-before原则”的理解可能是错的?
- How to connect tdengine through idea database management tool?
- [wp][gwctf 2019] boring lottery
- 科技论文翻译,俄语文档的语法有何特点
- [mathematical modeling] analytic hierarchy process (AHP)
- Annotation @autowired how to assemble automatically
- Nacos 介绍和部署
猜你喜欢

Five simple and practical daily development functions of chrome are explained in detail. Unlock quickly to improve your efficiency!

There was an unexpected error (type=method not allowed, status=405)

Briefly describe the application fields of WMS warehouse management system

Redis solves the problem of oversold inventory

图像非局部均值滤波的原理

Study of const of constant function

C语言力扣第41题之缺失的第一个正数。两种方法,预处理快排与原地哈希

Customer service relationship management based on SQL net enterprise messenger enterprise communications

Axi protocol (4): signals on the Axi channel

Icml2022 | imitation learning by evaluating the professional knowledge of the presenter
随机推荐
嵌入式分享合集20
What is the real HTAP? (1) Background article
推荐12个免费查找文献的学术网站,建议点赞、收藏!
公交站间的距离 : 简单模拟题
[mathematical modeling] analytic hierarchy process (AHP)
Add and modify the verification logic, and use -validation- to complete the group verification
Character function and string function (I)
Excel VBA: realize automatic drop-down filling formula to the last line
Principle of image nonlocal mean filtering
@Principle of Autowired annotation
AXI协议(4):AXI通道上的信号
vector详解和迭代器失效问题
The landing of tdengine in the GPS and AIS scheduling of Zhongtian steel
What are the restrictions on opening futures accounts? Where is the safest place to open an account?
【Leetcode】493. Reverse Pairs
nacos注册中心
一次线上事故,我顿悟了异步的精髓
JVM Lecture 6: how to solve the frequent FGC in online environment?
Rman-06031 cannot convert database keywords
黑吃黑?男子破解赌博网站漏洞,每月“薅羊毛”10多万元