当前位置:网站首页>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.
边栏推荐
- 【接口测试】JMeter调用JS文件实现RSA加密
- 一个关于操作数据库的建议—用户密码
- ISC2022 HackingClub白帽峰会倒计时1天!最全议程正式公布!元宇宙集结,精彩绝伦!
- 可视化——Superset使用
- [@synthesize in Objective-C]
- 回收租凭系统100%开源无加密 商城+回收+租赁
- ISC2022 HackingClub white hat summit countdown 1 day!Most comprehensive agenda formally announced!Yuan universe, wonderful!
- shell programming conventions and variables
- 牛血清白蛋白-葡聚糖-叶黄素纳米颗粒/半乳糖白蛋白磁性阿霉素纳米粒的制备
- Appendix A printf, varargs and stdarg a. 2 use varargs. H to realize the variable argument list
猜你喜欢
随机推荐
C Expert Programming Chapter 1 C: Through the Fog of Time and Space 1.5 ANSI C Today
Spark shuffle调优
Spark practice questions + answers
关于npm的那些事儿
Based on php hotel online reservation management system acquisition (php graduation project)
网络水军第一课:手写自动弹幕
方舟:生存进化PVE模式和PVP模式
用户量大,Redis没法缓存响应,数据库宕机?如何排查解决?
C Pitfalls and Defects Chapter 7 Portability Defects 7.11 An Example of a Portability Problem
RecycleView的使用
C Pitfalls and pitfalls Appendix B Interview with Koenig and Moo
PyQt5 + MySQL5.8 【学生信息管理系统】【增删改查】
【Objective-C中的@synthesize】
【Jmeter常用断言组件】
C语言必杀技3行代码把运行速度提升4倍
ImportError: `save_weights` requires h5py.问题解决
方舟开服需要知道的那些事
线上一次JVM FullGC搞得整晚都没睡,彻底崩溃~
JVM内存结构详解
shell编程规范与变量









