[RRFC] make npm update useful for modern package management
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 777
- Forks
- 267
- PR merge metrics
- No merged PRs in 30d
Description
Motivation ("The Why")
Today, I wouldn't be surprised if updating packages is more common than installing packages. The npm install DX is pretty good, but npm update is sorely lacking to the point that we've collectively built a lot of tools to try to help.
IMO the growth of tooling in this space is a result of the lack of strong update management being a norm in the package management tools we rely on at the root. I'd really like to see npm be able to support the average (modern) user's dependency update requirements, rather than those users reach to third-party tooling to achieve good dependency updates.
Example
- open up any project older than 1 month and try to update dependencies. it's going to be rough. it should be better.
How
Current Behaviour
- npm update
- does something but good luck figuring out if your dependencies are actually as up to date as is possible. they're probably not.
Desired Behaviour
- user runs
npm update- npm does a fresh fetch of dependencies outside of what's already resolved in node_modules and pacakge-lock.json
- tell user what modules are different
- allow
-yflag for auto-apply - let users interactively update dependencies if the
-yflag is missing
- npm does a fresh fetch of dependencies outside of what's already resolved in node_modules and pacakge-lock.json
a different way to look at this:
- GitHub Actions workflow runs
npm update -y- set up to automatically PR changes applied to
package.jsonif anything changes - I should never have to see a Dependabot PR if this workflow were to run and be merged prior to Dependabot being triggered, since
npm updatewould have already updated everything.
- set up to automatically PR changes applied to
yet another way to look at this:
- Dependabot should be able to adopt
npm updatewith limited additional configuration to power their JavaScript update tooling.
References
- https://github.com/npm/rfcs/issues/555 is similar but not fundamentally the same as this
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the requested behavior in issue #571 and compare it with the related npm RFC in issue #555. Run npm update on a project with existing package.json and package-lock.json to examine the current result; done would require agreeing on fresh dependency resolution, change reporting, interactive updates, and the proposed -y behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100