当前位置:网站首页>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
XXPackage installed innode_modulesDirectory - stay
npm5Before the release ,XXWill not automatically writepackage.json - stay
npm5Then it will be written automaticallypackage.jsonOfdependenciesProperties of the ( And--saveidentical )
npm install XX -g
-gMeans to install the module to overall situation , Where to install on the disk , Want to seenpm config prefixThe location ofThe specific check method is to input
npm config edit, Find in the pop-up document ;prefix=C:\nodeIs it
npm install XX --save( Shorthand for npm i XX -S)
Will be able to
XXPackage installed innode_modulesDirectory ,Will be in
package.jsonOfdependenciesAdd... Under propertiesXX- function
npm install --productionOr annotateNODE_ENVVariable value isproductionwhen ( Installation in production environment depends on ), The module will be automatically downloaded tonode_modulesDirectory .stay
npm5Then it can benpm i xxreplace
dependenciesThe 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
axiosrequest , Because it still needs to be used after release to productionaxios, This will makeaxiosThe installation todependencies
npm install XX --save-dev( Shorthand for npm i XX -D)
Will be able to
XXPackage installed innode_modulesDirectoryWill be in
package.jsonOfdevDependenciesAdd... Under propertiesXXfunction
npm install --productionOr annotateNODE_ENVVariable value isproductionwhen ( Installation in production environment depends on ), Modules will not be automatically downloaded tonode_modulesDirectory .
devDependenciesThe 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
ES6Code , needbabelconvert 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 makebabelThe installation todevDependencies
边栏推荐
猜你喜欢

Rehabilitation type force deduction brush question notes D1

Skywalking全部

数学分析_笔记_第8章:重积分

Positive height system

Use ffmpeg to rotate, flip up and down, and flip horizontally

扫盲-以太网MII接口类型大全-MII、RMII、SMII、GMII、RGMII、SGMII、XGMII、XAUI、RXAUI

SD_CMD_RECEIVE_SHIFT_REGISTER

Ros2 - configuration development environment (V)

【软件测试】02 -- 软件缺陷管理

All English in the code
随机推荐
Matlab在线性代数中的应用(四):相似矩阵及二次型
在本地搭建一个微服务集群环境,学习自动化部署
Page type
小米笔试真题一
Ros2 - Service Service (IX)
全局变量和静态变量的初始化
LSA Type Explanation - lsa-5 (type 5 LSA - autonomous system external LSA) and lsa-4 (type 4 LSA - ASBR summary LSA) explanation
能量守恒和打造能量缺口
Mipi interface, DVP interface and CSI interface of camera
Error: “MountVolume.SetUp failed for volume pvc 故障处理
程序中的负数存储及类型转换
Vant weapp swippecell set multiple buttons
window navicat连接阿里云服务器mysql步骤及常见问题
Unity 之 ExecuteAlways正在取代ExecuteInEditMode
Ros2 - configuration development environment (V)
PHY驱动调试之 --- MDIO/MDC接口22号和45号条款(一)
Ros2 topic (VIII)
并发编程 — 如何中断/停止一个运行中的线程?
Volcano resource reservation feature
Initialization of global and static variables