Package Management Introduction
A package manager is a tool that automatically installs and manages external libraries used by a program.
Think of it as a shopping service that buys the ingredients listed in a recipe for you. You only need to write the recipe (package.json for JavaScript, or requirements.txt / pyproject.toml for Python), and the package manager gathers everything you need.
Why Package Managers Matter
Section titled “Why Package Managers Matter”Modern web development often depends on dozens or even hundreds of external libraries. Managing them by hand creates several problems:
- Dependency management becomes difficult - Humans cannot realistically track complex dependency trees where library A needs version 2.x of library B while library C needs version 3.x.
- Version mismatches are easy to create - If each team member installs different versions, one environment may work while another fails.
- Installation becomes tedious - Every new team member would have to install each required library manually.
Package managers solve all of these problems. Once dependencies are recorded in a file such as package.json or requirements.txt, a single command can recreate the same environment for everyone.
What You Will Learn
Section titled “What You Will Learn”This section covers the main package managers used in JavaScript / Node.js and Python.
JavaScript / Node.js Package Managers
Section titled “JavaScript / Node.js Package Managers”| Tool | Features | Best For |
|---|---|---|
| npm | Built into Node.js. No extra installation required | Beginners and all Node.js projects |
| pnpm | Faster than npm and saves disk space with a global store | Developers managing multiple projects |
npm (Node Package Manager) is the package manager that comes with Node.js. Since it is available automatically after installing Node.js, it is the most widely used starting point for JavaScript development.
pnpm (Performant npm) is a package manager designed as a more efficient alternative to npm. It installs faster and uses much less disk space, which is especially useful when you are working on many projects at once.
Python Package Managers
Section titled “Python Package Managers”| Tool | Features | Best For |
|---|---|---|
| pip | Built into Python. No extra installation required | Beginners and all Python projects |
| uv | A Rust-based ultra-fast tool. Often 10 to 100 times faster than pip | Speed-focused work, AI development, and CI environments |
pip is the package manager that comes with Python. With pip install, you can install more than 500,000 packages published on PyPI. The standard workflow is to manage dependencies per project with a virtual environment (venv).
uv is a fast Python package manager written in Rust. It works much like pip, but installs much faster. In 2026, it is increasingly common in AI development and works well with Claude Code because it speeds up project setup.
Which One Should You Start With?
Section titled “Which One Should You Start With?”If you are new to package management, start with the standard tool for the language you use.
- If you use JavaScript: start with npm, then move to pnpm when you want more speed
- If you use Python: start with pip, then move to uv when you need better speed or CI efficiency
The smoothest learning path is to understand the standard tool first, then move to a faster tool when needed.
Frequently Asked Questions
Section titled “Frequently Asked Questions”Q: Are package managers only for JavaScript?
A: No. Every programming language has its own package manager. This section covers JavaScript / Node.js tools (npm and pnpm) and Python tools (pip and uv).
| Language | Standard Tool | Faster Tool |
|---|---|---|
| JavaScript / Node.js | npm | pnpm |
| Python | pip | uv |
| Ruby | gem | bundler |
| Rust | cargo | - |
Q: Can npm and pnpm be used at the same time?
A: Yes, but not in the same project. You can install both on your machine and choose one per project. The same applies to pip and uv.
Q: Where are JavaScript packages installed?
A: They are installed in the node_modules folder inside the project directory. Because this folder can become very large, it should not be tracked by Git.
Q: Where are Python packages installed?
A: If you use a virtual environment (venv), they are stored inside the project folder. If you install globally without a virtual environment, they are stored in Python’s site-packages. Using a virtual environment is recommended.