# acp: Use npm \-\-prefix for registry npx agents \(\#53560\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 07e9a2d25aa296c2513c9d59cb3ff675efb58c5e

Requested commit: 07e9a2d25aa296c2513c9d59cb3ff675efb58c5e

Commit: 07e9a2d25aa296c2513c9d59cb3ff675efb58c5e

Tree: 607e83719e66dc4dda02f508446721104f4cb438

Author: Ben Brandt

Committer: GitHub

## Message

```
acp: Use npm --prefix for registry npx agents (#53560)

Because we weren't going through the normal npm subcommand route, we
weren't getting a prefix flag applied. Which meant some users were
seeing errors of incorrect package managers when used with a JS project.

We still want the agent to run in the project dir if we can, we just
don't want it resolving packages from that project. (This actually means
I can run it in our claude-agent-acp repo again :D )

I refactored the node_runtime functions a bit to make these subcommand
functions a bit more inline wiht each other and actually fixed an issue
where --prefix might have been added after `--` previously which
wouldn't be correct anyway.

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

Release Notes:

- acp: Fix npm-based agents resolving based on current project.
```

## Parents

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

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