当前位置:网站首页>The thing about npm
The thing about npm
2022-08-01 21:35:00 【Slugs are not alone】
Things about npm
I. What is npm
npm is a package management tool officially provided by node, which is used to solve the problem of node code deployment. When installing Node.js, the corresponding npm version will be automatically installed.
Using the npm package management tool can solve the needs of the following scenarios:
- Download third-party packages written by others from the npm server to the local
- Download and install the command program written by others from the npm server to the local
- Upload your own package or command-line program to the npm server for others to use
Second, commonly used npm commands
npm install: To install all the packages required by the project, you need to configure the package.json file
npm uninstall: to uninstall the package of the specified name
npm update: to update the package of the specified name
npm start: to start the project
npm run bulid: project build
npm init: used to initialize and generate a new package.json file
npm set: used to set environment variables
npm info: view the specific information of each module
About the difference between npm install, npm install --save, npm install --save -dev and npm install -g
npm install:
will install the X package into the node_modules directory
will not modify package.json
run npm install, the X package will not be downloaded automatically
npm install --save:
The X package will be installed in the node_modules directory
X will be added under the dependencies property of package.json
Run npm install, it will beAutomatically install the X package into node_modules
After running npm install --production or specify the NODE_ENV variable value as production, X will be automatically installed in the node_modules directory
npm install --save -dev:
will install the X package into the node_modules directory
will add X under the dependencies property of package.json
run npm install, the X package will be automatically installed into node_modules
After running npm install –production or when the NODE_ENV variable value is marked as production, X will not be automatically installed in the node_modules directory
npm install -g:
The X package will be installed directly globally and will not appear in node_modules
The X package will not be automatically downloaded when running npm install
Summary
npm install just downloads the dependencies locally and does not modify package.json.
npm install -save will download the dependencies to the local, and modify the package.json, the project initialization npm install will download.
npm install --save-dev indicates that this dependency is only used in the development environment. If the project is packaged, this dependency will not be added to the build package.Use --save for packages that need to be used at runtime, otherwise use --save -dev.
npm install -g: download locally and globally without modifying package.json.
边栏推荐
- Spark practice questions + answers
- C Pitfalls and Defects Chapter 7 Portability Defects 7.8 Size of Random Numbers
- Realize the superposition display analysis of DWG drawing with CAD in Cesium
- JS Improvement: Handwritten Publish Subscriber Model (Xiaobai)
- Based on php online music website management system acquisition (php graduation design)
- 左旋氧氟沙星/载纳米雄黄磁性/As2O3磁性Fe3O4/三氧化二砷白蛋白纳米球
- 在Cesium中实现与CAD的DWG图叠加显示分析
- 牛血清白蛋白-葡聚糖-叶黄素纳米颗粒/半乳糖白蛋白磁性阿霉素纳米粒的制备
- 数据库练习
- C语言_typedef和结构体
猜你喜欢

Day33 LeetCode

包含吲哚菁绿的多聚体白蛋白纳米球/载马钱子碱纳米粒的牛血清白蛋白微球的制备

方舟:生存进化官服和私服区别

C Expert Programming Preface

图像融合GANMcC学习笔记

Based on php hotel online reservation management system acquisition (php graduation project)

2022-08-01 第五小组 顾祥全 学习笔记 day25-枚举与泛型

Upload markdown documents to blog garden

Based on php Xiangxi tourism website management system acquisition (php graduation design)

Based on php tourism website management system acquisition (php graduation design)
随机推荐
对C语言结构体内存对齐的理解
Port protocol for WEB penetration
空间数据库开源路,超图+openGauss风起禹贡
Appendix A printf, varargs and stdarg A.3 stdarg.h ANSI version of varargs.h
P7215 [JOISC2020] 首都 题解
Pagoda application experience
[@synthesize in Objective-C]
AIDL通信
测试的意义并不是能找到全部的缺陷
C陷阱与缺陷 第7章 可移植性缺陷 7.6 内存位置0
Suggestions and answer 8.1 C traps and defect chapter 8
牛血清白蛋白刺槐豆胶壳聚糖缓释纳米微球/多西紫杉醇的纳米微球DTX-DHA-BSA-NPs
C Pitfalls and pitfalls Appendix B Interview with Koenig and Moo
基于php在线考试管理系统获取(php毕业设计)
Spark shuffle调优
【力扣】字符串相乘
365 days challenge LeetCode1000 questions - Day 046 Generate a string with odd number of each character + add two numbers + valid parentheses
宝塔应用使用心得
Spark集群搭建
作业8.1 孤儿进程与僵尸进程