Websites and web tools
Package manager myths debunked
Package managers install the libraries a project depends on, and a few widely held beliefs about them cause most dependency trouble. Each myth below is followed by what actually happens and a habit that prevents the problem, for anyone maintaining a small business site or app.
Myth 1: the lockfile is optional
Without a committed lockfile, two installs a week apart can pull different versions of indirect dependencies. The app that worked on your laptop may fail on the server. Commit the lockfile and use the install command that respects it exactly in CI, such as npm ci.
Myth 2: a caret range means this exact version
| Range | Allows | Example match |
|---|---|---|
1.4.2 | Only 1.4.2 | 1.4.2 |
~1.4.2 | At least 1.4.2, below 1.5.0 | 1.4.9 |
^1.4.2 | At least 1.4.2, below 2.0.0 | 1.9.0 |
^0.4.2 | At least 0.4.2, below 0.5.0 | 0.4.7 |
The caret allows new minor releases, which should be compatible but sometimes are not. The lockfile is what pins the real version.
Myth 3: latest is always safest
New versions fix bugs and holes, but they can also add new ones, and a hijacked release is by definition the newest. Update on purpose, read the changelog for major versions, and give a brand-new release a short wait before you adopt it unless it fixes a security issue that affects you.
Myth 4: popular means trustworthy
Download counts show use, not review. Check who maintains the package, whether the source repository matches what is published, and whether install scripts run code on your machine. Watch for names one letter away from a popular package.
Myth 5: deleting the dependency folder fixes everything
A clean reinstall can clear a corrupted install, but if the lockfile itself is wrong, you just reinstall the same problem. Read the actual error first. Look for a version conflict, a missing native build tool, or a cache problem.
Myth 6: an audit with zero warnings means the project is secure
Audit commands only report known, published vulnerabilities in packages they can see. They do not review your own code, your server settings or a malicious package nobody has flagged. Treat a clean audit as one check among several.
Myth 7: development dependencies do not matter
Build tools run on your machine and in CI with access to your files and sometimes your secrets. A compromised build tool can alter what you ship. Keep them updated and trimmed like any other dependency.
Habits that replace the myths
- Commit the lockfile and install from it in CI.
- Update dependencies on a schedule, one group at a time, with tests.
- Remove packages you no longer use.
- Read install scripts before allowing them.