# acp: Allow resolving older npm package versions \(\#55770\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/cdbab194b7cba474daab84310e8c57be8b8bdaf9)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: cdbab194b7cba474daab84310e8c57be8b8bdaf9

Requested commit: cdbab194b7cba474daab84310e8c57be8b8bdaf9

Commit: cdbab194b7cba474daab84310e8c57be8b8bdaf9

Tree: 65a770a1c9acb6b24b744625211f38cde344a2f3

Author: Ben Brandt

Committer: GitHub

## Message

```
acp: Allow resolving older npm package versions (#55770)

Lots of people are using `min-release-age` in their .npmrc files these
days.

I saw two options:

1. Force min-release-age=0 so we can always install the latest
2. Be more lenient in what we allow

I opted for 2, which means we convert `package@0.1.2` to
`package@<=0.1.2`. This means npm can find the latest version we can
that meets the user's requirements.

The downside is, the registry args/env may or may not work with the
resolved version, but that should at least surface better thanks to
#55757

There is also the issue that npm will cache package metadata and an
older version it has cached would still resolve. However, once the
metadata is updated, npm does use the newer tarball at least, so it will
update eventually.

It's a tradeoff, but I'd rather start with this until we have a better
solution on the ACP registry, rather than have users be upset becaue we
installed packages in a way they didn't want.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes
https://github.com/agentclientprotocol/claude-agent-acp/issues/516

Release Notes:

- acp: Better support min-release-age settings for npx-based agents from
the registry
```

## Parents

- [7a34bc059e7344e1814c87f994c963b6d8cf5c20](https://git.cafe/gitcafe/zed/commit/7a34bc059e7344e1814c87f994c963b6d8cf5c20?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/cdbab194b7cba474daab84310e8c57be8b8bdaf9?format=markdown)
