Home >Web Front-end >JS Tutorial >A brief analysis of the usage of Node.js package management tools npm and yarn
This article will introduce you to Node.jsHow to use the package management tools npm and yarn, and help you quickly get started with npm and yarn.
This article learns the use of the package management tool
npm
&yarn
ofnode.js
. [Recommended learning: "nodejs Tutorial"]
npm
Shared projects: npm official website: npmjs.com
Register an account on npm.js
:
1. Use npm
2. Turn the node project into a package
npm init
Requires package name It must be the only one in the entire network
3. Upload the node package
npm adduser
4. Transfer the local package to the online warehouse
npm publish
##5 , Download the online node package npm install package name npm i lichune201807091415
Install Taobao image:npm install -g cnpm --registry=https://registry.npm. taobao.org (Understand)
npm to
cnpm to
dependencies and
devDependencies?
Small disadvantages of npm
Yarn documentation & download and installation
Yarn Yes One command is a wrapper for the
npm command
npm install yarn -g
##yarn<span style="font-size: 16px;"></span> Usage:
, enter the name of the package and press Enter. Use yarn to turn the code into a package (npm init)
npm adduser
yarn publish
=== npm publish
==== npm install
Batch install all plug-ins in package.json
Update a dependent package
The benefits of deleting a dependent package
##yarn<span style="font-size: 16px;"> : </span>
yarn
yarn! !
The above is the detailed content of A brief analysis of the usage of Node.js package management tools npm and yarn. For more information, please follow other related articles on the PHP Chinese website!