NPM and Package Management

Review your understanding of npm,yarn,and dependency management.

1. What is the primary purpose of the 'npm init' command?
2. Which file in an NPM project contains metadata such as project name, version, and dependencies?
3. The 'package-lock.json' file is automatically generated to lock the exact versions of installed dependencies.
4. What command is used to install a package as a development dependency? (format: npm install <flag> <package>; include the flag)
5. Which of the following are valid dependency types in a package.json file?
6. What does the '-g' flag indicate when used with 'npm install <package>'?
7. Which command is used to uninstall a locally installed NPM package?
8. Which NPM commands can be used to update installed dependencies?
9. Dev dependencies are required for the application to run in production.
10. What does 'NPM' stand for?
11. What is the primary purpose of the 'npx' command?
12. In semantic versioning (semver), what does the 'MINOR' number in 'MAJOR.MINOR.PATCH' represent?
13. Which files/directories should typically be excluded from version control (e.g., Git) in an NPM project?
14. Running 'npm install' without any arguments installs all dependencies listed in package.json.
15. What is the shorthand alias for the 'npm install' command?
16. What is the purpose of the 'npm audit' command?
17. Which version specifiers in package.json will install version 2.3.4 or higher but less than 3.0.0?
18. What is a 'scoped package' in NPM?
19. Peer dependencies specified in package.json are automatically installed by NPM.
20. Name the file that records exact versions of all installed dependencies to ensure reproducible builds.
Answered 0 of 0 — 0 correct