当前位置:网站首页>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
边栏推荐
猜你喜欢

并发编程 — 如何中断/停止一个运行中的线程?

Marvell 88e1515 PHY loopback mode test
![[untitled]](/img/d5/2ac2b15818cf66c241e307c6723d50.jpg)
[untitled]

Marvell 88E1515 PHY loopback模式测试

你心目中的数据分析 Top 1 选 Pandas 还是选 SQL?

Inftnews | drink tea and send virtual stocks? Analysis of Naixue's tea "coin issuance"

MySQL (UDF authorization)

并发编程 — 死锁排查及处理

【MySQL8.0不支持表名大写-对应方案】

Positive height system
随机推荐
LSA Type Explanation - detailed explanation of lsa-2 (type II LSA network LSA) and lsa-3 (type III LSA network Summary LSA)
解读最早的草图-图像翻译工作SketchyGAN
window navicat连接阿里云服务器mysql步骤及常见问题
A brief introduction to heading/pitch/roll and omega/phi/kappa
PowerManagerService(一)— 初始化
About vscode, "code unreachable" will be displayed when calling sendline series functions with pwntools“
Marvell 88E1515 PHY loopback模式测试
Configuration method and configuration file of SolidWorks GB profile library
基于FPGA的一维卷积神经网络CNN的实现(八)激活层实现
数据库Mysql全部
UIO driven framework
LSA Type Explanation - lsa-5 (type 5 LSA - autonomous system external LSA) and lsa-4 (type 4 LSA - ASBR summary LSA) explanation
.net core踩坑实践
乐鑫面试流程
Some classic recursion problems
[MySQL 8.0 does not support capitalization of table names - corresponding scheme]
【软件测试】04 -- 软件测试与软件开发
6-2 sequence table operation set
三体目标管理笔记
Interpretation of the earliest sketches - image translation work sketchygan