当前位置:网站首页>The difference between NPM install -g/-save/-save-dev
The difference between NPM install -g/-save/-save-dev
2022-07-05 07:03:00 【Underwater barbecue shop AI】
npm install XX ( Shorthand for npm i XX)
- Will be able to
XX
Package installed innode_modules
Directory - stay
npm5
Before the release ,XX
Will not automatically writepackage.json
- stay
npm5
Then it will be written automaticallypackage.json
Ofdependencies
Properties of the ( And--save
identical )
npm install XX -g
-g
Means to install the module to overall situation , Where to install on the disk , Want to seenpm config prefix
The location ofThe specific check method is to input
npm config edit
, Find in the pop-up document ;prefix=C:\node
Is it
npm install XX --save( Shorthand for npm i XX -S)
Will be able to
XX
Package installed innode_modules
Directory ,Will be in
package.json
Ofdependencies
Add... Under propertiesXX
- function
npm install --production
Or annotateNODE_ENV
Variable value isproduction
when ( Installation in production environment depends on ), The module will be automatically downloaded tonode_modules
Directory .stay
npm5
Then it can benpm i xx
replace
dependencies
The dependency in is Dependencies in the production environment , It will also be installed in the production environment after the project deployment , for example :
It was used
axios
request , Because it still needs to be used after release to productionaxios
, This will makeaxios
The installation todependencies
npm install XX --save-dev( Shorthand for npm i XX -D)
Will be able to
XX
Package installed innode_modules
DirectoryWill be in
package.json
OfdevDependencies
Add... Under propertiesXX
function
npm install --production
Or annotateNODE_ENV
Variable value isproduction
when ( Installation in production environment depends on ), Modules will not be automatically downloaded tonode_modules
Directory .
devDependencies
The dependency in is Dependency only in the development environment , It will not be installed in the production environment after the project deployment , for example :
Write
ES6
Code , needbabel
convert toes5
, After the conversion , We just need the converted code , When you go online , Directly deploy the converted code to the production environment , Unwantedbebal
了 , The production environment doesn't need , This will makebabel
The installation todevDependencies
边栏推荐
- Ros2 - common command line (IV)
- Mid 2022 documentary -- the experience of an ordinary person
- Ros2 - ros2 vs. ros1 (II)
- 6-3 find the table length of the linked table
- 使用paping工具进行tcp端口连通性检测
- Unity 之 ExecuteAlways正在取代ExecuteInEditMode
- Volcano resource reservation feature
- Qt项目中的日志库log4qt使用
- 乐鑫面试流程
- How to answer when you encounter a jet on CSDN?
猜你喜欢
Use ffmpeg to rotate, flip up and down, and flip horizontally
Rehabilitation type force deduction brush question notes D2
IPage能正常显示数据,但是total一直等于0
PHY drive commissioning - phy controller drive (II)
inux摄像头(mipi接口)简要说明
ROS2——topic话题(八)
Rehabilitation type force deduction brush question notes D1
Dameng database all
postmessage通信
1290_FreeRTOS中prvTaskIsTaskSuspended()接口实现分析
随机推荐
Integer to 8-bit binary explanation (including positive and negative numbers) scope of application -127~+127
Orin installs CUDA environment
Page type
Orin 两种刷机方式
Get class files and attributes by reflection
docker安装mysql并使用navicat连接
The difference between new and malloc
kata container
Special training of C language array
Lexin interview process
扫盲-以太网MII接口类型大全-MII、RMII、SMII、GMII、RGMII、SGMII、XGMII、XAUI、RXAUI
Positive height system
NVM Downloading npm version 6.7.0... Error
全局变量和静态变量的初始化
U-Boot初始化及工作流程分析
Cookie、Session、JWT、token四者间的区别与联系
Database mysql all
数学分析_笔记_第8章:重积分
Ros2 - node (VII)
Skywalking all