当前位置:网站首页>NPM common commands use commands to delete nodes_ Modules package
NPM common commands use commands to delete nodes_ Modules package
2022-07-18 22:44:00 【xsqsharp】
see npm command
npm help
Global command parameters -g
npm install -g // Install Global npm uninstall -g // Unload the global
overall situation node In bag i5ting_toc This bag can handle md Format the file into a web page function i5ting_toc -f file name .md -0
Version installed
You can specify which version of the package to use npm install Package name @ Version number Install the latest version without
Project installation
initialization package.json
npm init -y
Installation package
install package Configuration in
npm install
Install multiple packages
npm install Package name 1 Package name 2 Package name 3
production / Development parameters
npm i Package name --save ( -S ) // Dependent packages for production environments ==> dependencies
npm i --production // Only install package in dependencies The bag inside
npm install Package name --save-dev( -D ) // For development environment ==> devDependencies
npm install // All packages will be installed View package information
npm info Package name
Solve the problem of being walled
Set the image path
npm config set registry= Mirror address (https//registry.npm.taobao.org)
Use cnpm
npm install cnpm -g
Use nrm Change image
npm install nrm // download nrm use taobao // Change image
function package.json in scripts Set command
npm run dev // script Script configured in
Other commands
npm ls --depth 0 -g // Look at what failed npm prune -g // Trim the global package npm rebuild -g // Rebuild global package npm update -g // Update the version of the global package npm cache clear --force -g // Delete the cache of the global package ( Be careful )
Delete node_modules
install rimraf
npm install rimraf -g // Use the command to delete rimraf node_modules // You can also delete other folders or files
package.json Field analysis
name: The name of the package , Must be unique , By lowercase letters 、 Numbers and underscores , Cannot contain spaces
description: A brief description of the package
version: A version string that conforms to the semantic version recognition specification
keywords: Keyword array , Usually used to search for
maintainers: Maintainer array , Each element should contain name、email( Optional )、web( Optional ) Field
contributors: Contributor array , Format and maintainers identical . The author of the package should be the first in the contributor array - Elements
bugs: Submit bug The address of , It could be a website or an email address
licenses: License array , Each element should contain type( License name ) and url( Link to... Of the license text - Address ) Field
repositories: Warehouse managed address array , Each element should contain type( Warehouse type , Such as git)、url( warehouse - The address of the library ) and path( Path relative to warehouse , Optional ) Field
dependencies: Dependency of production environment package , An associative array , Consists of the package name and version number
devDependencies: Dependency of development environment package , An associative array , Consists of the package name and version number
yarn
yarn It's also a package management tool , Most orders come from npm be similar
It can be done by npm Global installation yarn
npm install -g yarn
initialization package and npm similar
yarn init -y
Download all package All the dependencies in
yarn install // Download all dependencies yarn install --flat // Only one version of each dependency is allowed yarn install --force // Pull all bags again , Even if it has been installed before .
Installation package
yarn add Package name // Add a dependency package yarn add Package name Package name Package name // Add multiple dependent packages yarn global add Package name // Global installation yarn add Package name -D // Add a dependency package to the development dependency yarn add Package name -P // Add a dependency package to the production dependency
Display the information of a package
yarn info Package name
function package.json in scripts Set command
yarn run dev // scripts Script configured in
边栏推荐
- 华为 机考js 素数之积
- Activity review | in depth chat with mindspire: how open source explores the whole scene of AI field
- Accéder aux variables locales dans une classe interne anonyme
- 修改服务器密码
- mapbox-gl加载3dtiles渐变模型(视频)
- Botu PLC Fuzzy PID control (quantitative factor and proportional factor)
- MySQL transaction operation and locking mechanism
- UCOS III learning notes (11) -- task semaphores and task message queues
- Definition and usage of several special standards of C language
- Huawei od search for the same substring
猜你喜欢

uniapp基础知识

Nike, the leader of sports, is "red and black" in the trend of consumption recovery

记一次蚂蚁金服四面遭虐,面试水太深,过河的渡船你造好了吗?

技术干货 | 模型优化精度、速度我全都要!MindSpore模型精度调优实战(二)

How to return to the hyperlink in PDF after jumping? alt + ←

Myql database suddenly disappeared, how to restore it?

SIEMENS模块6DD1661-0AE1

技术干货| MindSpore新一代自主研发分子模拟库:Mind-Sponge

How to solve the problem of 8080 port being occupied? Win11 8080 port occupied solution

开发者分享|手写算子没那么难,教你用MindSpore实现自适应平均池化算子!
随机推荐
数据库常遇到的问题
Huawei od JS splicing URL
1. Create prism project
溢流阀力士乐ZDB10VP2-4X/315V
JS handwritten sort
千亿元宇宙市场,Soul、映客的新动力
Web development from entry to proficiency I (detailed)
Byte 3 finally landed. Please keep this hot noodle Sutra "including free information"
Dior is suspected of plagiarizing Chinese horse face skirt, and the product has been removed from the domestic official website
2 - Conan Binary package Dependence Management Scheme
开发者分享|手写算子没那么难,教你用MindSpore实现自适应平均池化算子!
surging作者出具压测结果
Leetcode 49. Alphabetic heterotopic word grouping
Nike, the leader of sports, is "red and black" in the trend of consumption recovery
看完这篇 教你玩转渗透测试靶机vulnhub——EvilBox-One
【部署】Redis
射击比赛的成绩 华为od js
transpose函数
Modify server password
Cmu15445 (fall 2019) project 4 - logging & Recovery details