-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnpm-info.txt
31 lines (19 loc) · 919 Bytes
/
npm-info.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
npm: Node Package Manager
npm - global command, comes with node
npm --version
local dependency - use it only in this particular project
npm i <packageName>
npm i <packageName> -D or npm i <packageName> --save-dev (to install packages as dev dependencies)
global dependency - use it in any project
npm install -g <packageName>
sudo npm install -g <packageName> (mac)
package.json - manifest file (stores important info about project/package)
manual approach (create package.json in the root, create properties etc)
npm init (step by step, press enter to skip)
npm init -y (everything default)
How to uninstall a package
1) npm uninstall packageName
2) delete node_modules and package-lock.json and the dependency from package.json and then run 'npm install' to reinstall other dependencies
npx enables us to use local dependencies as global
npm install -g npx
to run the app as global: npx packageName app.js