npm commands
Which command creates the package.json file interactively?
yes | no | |
| [ ] | [x] |
| [x] | [ ] |
| [ ] | [x] |
If you already have a package.json file, it'll read that first, and default to the options in there.
How do you install a package and save it as a dependency in the package.json file?
yes | no | |
| [x] | [ ] |
| [ ] | [x] |
| [x] | [ ] |
When uninstalling a package "save" flag will also update the dependency to package.json file:
npm uninstall <package name> --save
How do you list packages?
yes | no | |
| [x] | [ ] |
| [x] | [ ] |
| [ ] | [x] |
| [x] | [ ] |
Adding the "g" flag after "list" or "ls" will show you globally installed packages:
npm list -g
ornpm ls -g
Last updated