# node_runtime: Tolerate non-string values in npm time metadata \(\#57765\) · gitcafe/zed

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

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

Visibility: public

Requested revision: e25458243bb5f3522fd56c12d16d145e44395053

Requested commit: e25458243bb5f3522fd56c12d16d145e44395053

Commit: e25458243bb5f3522fd56c12d16d145e44395053

Tree: 37a0012cc6a3403f68abe503a47e48778f040120

Author: Luke Deen Taylor

Committer: GitHub

## Message

````
node_runtime: Tolerate non-string values in npm time metadata (#57765)

> [!NOTE] 
> Authored by Claude, but fixes a real issue I encountered; I have
reviewed the diff

Some npm registries return `npm info --json` with non-string values in
the `time` map. JFrog Artifactory emits `"unpublished": null`, and npm
itself represents `unpublished` as an object for packages that have had
versions unpublished.

Because `NpmInfo.time` was typed `HashMap<String, String>`, serde
aborted the entire deserialization with `invalid type: null, expected a
string`. As a result `select_npm_package_version` never ran, and
language servers installed via npm (for example the tsgo extension,
`tailwindcss-language-server`, and `json-language-server`) failed to
start with an error like:

```
Failed to start language server "tsgo": invalid type: null, expected a string at line 100 column 23
```

Only version keys in `time` are ever read (to honor npm's `before`
cutoff), so this deserializes the map leniently: keep the string-valued
entries and drop the rest. The field type and all downstream logic are
unchanged. Added a regression test covering a `time` map containing
`"unpublished": null`.

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
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed language servers failing to install when the npm registry
returns non-string values (such as `"unpublished": null`) in package
`time` metadata
````

## Parents

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

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