# Passthrough env to npm subcommands when using the system node runtime \(\#43102\) · gitcafe/zed

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

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

Visibility: public

Requested revision: b577f8a5ea3f4fc439a57c03126b20479d58ff2e

Requested commit: b577f8a5ea3f4fc439a57c03126b20479d58ff2e

Commit: b577f8a5ea3f4fc439a57c03126b20479d58ff2e

Tree: 0891a76df6c6ede8a799ef09661480b17e5ebbef

Author: Yeoh Joer

Committer: GitHub

## Message

```
Passthrough env to npm subcommands when using the system node runtime (#43102)

Closes #39448
Closes #37866

This PR expands the env-clearing fix from #42587 to include the
SystemNodeRuntime, which covers Node.js installations managed by Mise.
When running under the system runtime, npm subcommands were still
launched with a cleared environment, preventing variables such as
MISE_DATA_DIR from reaching the shim or the mise binary itself. As a
result, Mise finds the npm binary in the default MISE_DATA_DIR,
consistent with the behavior described in
https://github.com/zed-industries/zed/issues/39448#issuecomment-3433644569.

This change ensures that environment variables are passed through for
npm subcommands when using the system Node runtime, restoring expected
behavior for Mise-managed Node installations. This also fixes cases
where envs are used by npm itself.

Release Notes:

- Enable environment passthrough for npm subcommands
```

## Parents

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

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