当前位置:网站首页>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
边栏推荐
猜你喜欢

汉字风格迁移篇---通过生成对抗网络学习一对多程式化汉字的转换和生成

5个chrome简单实用的日常开发功能详解,赶快解锁让你提升更多效率!

未来大气污染变化模拟

Can serial port can 232 can 485 serial port to CANbus bus gateway module can232/485mb converter cancom

分子骨架跃迁工具-DeLinker介绍

MySQL八股知识点:从入门到删库

提高shuffle操作中的reduce并行度

Icml2022 | imitation learning by evaluating the professional knowledge of the presenter

vector详解和迭代器失效问题

Switch to router technology: OSPF single zone configuration, OSPF multi zone and end zone
随机推荐
C language - pointer one touch ※
CMD操作命令
Two ways to create MySQL database
columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by mysql8.0解决办法
MySQL八股知识点:从入门到删库
CLM陆面过程模式
security权限管理详解
Redis expiration deletion strategy and memory obsolescence strategy
pillow的原因ImportError: cannot import name ‘PILLOW_VERSION‘ from ‘PIL‘,如何安装pillow<7.0.0
List converted to tree real use of the project
Five simple and practical daily development functions of chrome are explained in detail. Unlock quickly to improve your efficiency!
Recommendation system - machine learning
Redis solves the problem of oversold inventory
New knowledge in big homework
Ggjj, do you have a look at this problem? Does caching cause cross domain problems?
Rman-06031 cannot convert database keywords
@Principle of Autowired annotation
Switch to router technology: OSPF single zone configuration, OSPF multi zone and end zone
基于R语言的Meta分析【全流程、不确定性分析】方法与Meta机器学习
Customer service relationship management based on SQL net enterprise messenger enterprise communications