-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnpm-notes.txt
51 lines (31 loc) · 1.1 KB
/
npm-notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
**** To initialize npm ****
npm init
**** To install packages using npm ****
npm install package-name
npm i package-name
example : npm install express
example : npm i express
***** To check the version of any package ****
npm view package-name version
npm view express version
**** To uninstall packages using npm ****
npm uninstall package-name
example : npm uninstall express
**** to install dependencies ****
npm install **its also used when we accidentally delete our node_modules folder to install it again
npm i
**** To install specific version of any package ****
npm install package-name@version
example : npm install slugify@1.1.2
version system x.y.z (major.minor.patch)
where x is major, y is minor and z is patch
tag before version ^,>,~
^ : Exact version mention
> : greater than or latest version of package released
~ : install with minor new patch and function
**** To install packages just for development ****
npm install package-name --save-dev
example : npm install nodemon --save-dev
**** To use the package globally ****
npm install package-name --global
npm install nodemon --global