Loading

Quipoin Menu

Learn • Practice • Grow

node-js / Installing Packages
mcq
Direction: Choose the correct option

Q1.

How do you install a package locally (default)?
A. npm add <package-name> --global
B. npm get <package-name>
C. npm install <package-name>
D. npm install -g <package-name>
Direction: Choose the correct option

Q2.

What flag installs a package globally?
A. #NAME?
B. #NAME?
C. #NAME?
D. Both A and B
Direction: Choose the correct option

Q3.

What is the difference between `--save` and `--save-dev`?
A. They are the same
B. `--save` is global, `--save-dev` is local
C. `--save` is for production, `--save-dev` for development
D. `--save` installs dev tools
Direction: Choose the correct option

Q4.

How do you install a specific version of a package?
A. npm get <package> <version>
B. npm install <package> -v <version>
C. npm install <package> --version <version>
D. npm install <package>@<version>
Direction: Choose the correct option

Q5.

What does `npm install` (with no arguments) do?
A. Updates npm itself
B. Uninstalls all packages
C. Installs nothing
D. Installs all dependencies listed in `package.json`