当前位置:网站首页>NPM install --global --save --save dev differences
NPM install --global --save --save dev differences
2022-06-30 15:04:00 【Pan Gao】
More , Please visit mine Personal blog .
npm install --global <XXX>
- The effect is equivalent to npm install -g <XXX>
- overall situation Install the module
- Can't Record module dependencies in dependencies or devDependencies In the object
- function npm install When initializing a project Can't Download module
For example, I run the following code in any directory :
npm install --global cowsay

Wrong report , It doesn't matter , This is mine npm Installed in the default directory , No access . I run it again with administrator privileges , Just fine :

After installed , In any directory throughout the computer , I can use this module , For example, enter a command , The returned information is as follows :
cowsay Pangao's station

npm install --save <XXX>
- The effect is equivalent to npm install -S <XXX>
- On the node_modules Install the module below
- stay package.json In the document dependencies Object to create a property , Used to record added dependencies
- function npm install When initializing a project , The module will be downloaded to the project node_modules Next
- function npm install --production The module will be automatically downloaded to the project node_modules Next
For example, I am in test1 Run the following code under the directory :
cd test1
npm install --save cowsay
The results are as follows :

npm install --save-dev <XXX>
- The effect is equivalent to npm install -D <XXX>
- On the node_modules Install the module below
- stay package.json In the document dependencies Object to create a property , Used to record added dependencies
- function npm install When initializing a project , The module will be downloaded to the project node_modules Next
- function npm install --production Can't Automatically download modules to the project node_modules Next
For example, I am in test2 Run the following code under the directory :
cd test2
npm install --save-dev cowsay
The results are as follows :

npm install <XXX>
- stay npm 5.0 And later on , Effect and npm install --save <XXX> As like as two peas
- stay npm 5.0 In previous versions ,npm install <XXX> The module will be downloaded to the specified project , also Can't stay package.json Document dependencies
For example, I am in test3 Run the following code under the directory :
cd test3
npm install cowsay
The results are as follows :

npm install And npm i The difference between
- use npm i The installed module cannot be used npm uninstall Delete , Must use npm uninstall i Just uninstall
- npm i Will help detect current node The version best matches npm Package version number , And match the interdependent npm The version number that the package should be upgraded
- part npm Package in the current node You can't use , The recommended version must be used
- When the installation reports an error intall There must be npm-debug.log file ,npm i not always
therefore , It is recommended to use npm install install , Instead of npm i install .
More programming teaching, please pay attention to the official account : Pangao will accompany you to learn programming

边栏推荐
- 文本匹配——【NAACL 2021】AugSBERT
- day02
- K - rochambau (joint search, enumeration)
- [untitled]
- J - Borg maze (minimum spanning tree +bfs)
- Maximum area of islands searched
- K - or unblocked project (minimum spanning tree)
- 001 basic knowledge (unfinished)
- CCF numerical sorting (Full Score code + problem solving ideas + skill summary) 201503-2
- Xiao Sha's pain (thinking problem)
猜你喜欢

ES6 notes

2021-07-14 mybaitsplus

Detailed explanation of settimeout() and setinterval()
![[matlab] 2D drawing summary](/img/de/6bb5385f440a2997dbf9cbb9a756eb.jpg)
[matlab] 2D drawing summary

@PathVariable

CCF elimination games (Full Score code + problem solving ideas + skill summary) February 2, 2015

day02

Shangpinhui knowledge points of large e-commerce projects

Matlab construction operation example

Svn password forgetting solution
随机推荐
这种零件该怎么编程加工?
Matlab function for limit, definite integral, first-order derivative, second-order derivative (classic examples)
Analysis on the problems of irregular step hole on horizontal machining center
I - constructing roads
[extensive reading of papers] multi modal sarcasm detection and human classification in code mixed conversations
Win10 backup backup shows that creating a shared protection point on the shadow failed
CCF access control system (Full Score code + problem solving idea) 201412-1
高清机械原理 · 机械设计经典动图
1130: find the first character that appears only once
CCF window (Full Score code + problem solving idea) March 2, 2014
Programming of left-hand trapezoidal thread
L - Jungle roads (minimum spanning tree)
Querywrapper in mybaits plus
Solve the problem that codeblocks20.03 on win11 cannot run for the first time
2021-07-15Caused by: org. quartz. ObjectAlreadyExistsException: Unable to store Job : ‘DEFAULT. TASK_ 1‘
Non decreasing column
@PathVariable
分布式--OpenResty+lua+Redis
Detailed explanation of settimeout() and setinterval()
CCF drawing (full mark code + problem solving ideas + skill summary) February 2, 2014