当前位置:网站首页>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
边栏推荐
- Technology blog learning website
- The difference between new and malloc
- Marvell 88e1515 PHY loopback mode test
- Ros2 - first acquaintance with ros2 (I)
- [tf] Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initial
- postmessage通信
- *P++, (*p) + +, * (p++) differences
- SD_CMD_SEND_SHIFT_REGISTER
- ROS2——配置开发环境(五)
- Xavier CPU & GPU 高负载功耗测试
猜你喜欢
随机推荐
The difference between new and malloc
Lexin interview process
ROS2——安装ROS2(三)
6-2 sequence table operation set
Ros2 - Service Service (IX)
Architecture
2022年中纪实 -- 一个普通人的经历
Ros2 - workspace (V)
Vscode configures the typera editor for MD
GDB code debugging
ROS2——Service服务(九)
vim
SD_CMD_SEND_SHIFT_REGISTER
LSA Type Explanation - lsa-1 [type 1 LSA - router LSA] detailed explanation
Skywalking all
Vscode editor
Cookie、Session、JWT、token四者间的区别与联系
PowerManagerService(一)— 初始化
ethtool 原理介绍和解决网卡丢包排查思路(附ethtool源码下载)
Skywalking全部