当前位置:网站首页>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
边栏推荐
- 能量守恒和打造能量缺口
- The problem of Chinese garbled code in the vscode output box can be solved once for life
- Error: “MountVolume.SetUp failed for volume pvc 故障处理
- Instruction execution time
- The difference between new and malloc
- 使用paping工具进行tcp端口连通性检测
- postmessage通信
- Some classic recursion problems
- Ros2 - node (VII)
- mysql设置触发器问题
猜你喜欢
Get class files and attributes by reflection
程序中的负数存储及类型转换
摄像头的MIPI接口、DVP接口和CSI接口
ROS2——配置开发环境(五)
C语言数组专题训练
【软件测试】04 -- 软件测试与软件开发
PHY drive commissioning --- mdio/mdc interface Clause 22 and 45 (I)
Financial risk control practice -- feature derivation based on time series
你心目中的数据分析 Top 1 选 Pandas 还是选 SQL?
Ros2 topic (VIII)
随机推荐
Get class files and attributes by reflection
UIO driven framework
Utf8 encoding
SOC_SD_CMD_FSM
Markdown syntax
window navicat连接阿里云服务器mysql步骤及常见问题
namespace
In C language, int a= 'R'
数据库Mysql全部
Configuration method and configuration file of SolidWorks GB profile library
在本地搭建一个微服务集群环境,学习自动化部署
PowerManagerService(一)— 初始化
Huawei bracelet, how to add medicine reminder?
代码中的英语全部
ROS2——Service服务(九)
Build a microservice cluster environment locally and learn to deploy automatically
达梦数据库全部
CGroup CPU group source code analysis
【软件测试】06 -- 软件测试的基本流程
Literacy Ethernet MII interface types Daquan MII, RMII, smii, gmii, rgmii, sgmii, XGMII, XAUI, rxaui