Skip to content

Install pyright's nodejs runtime for CI typechecking - #225

Merged
Eijebong merged 1 commit into
mozilla-releng:mainfrom
Eijebong:more-like-pywrong
Nov 3, 2026
Merged

Eijebong merged 1 commit into
mozilla-releng:mainfrom
Eijebong:more-like-pywrong

Conversation

@Eijebong

@Eijebong Eijebong commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

The CI image has no global node, so pyright falls back to running python -m nodeenv to download one, which ends up downloading v27.0.0-alpha.0.0.0. It then tries parsing that version and fails miserably because it assumes it's going to be [major].[minor].[patch], all ints and calls int("0-alpha"). So do what pyright suggests and install pyright[nodejs] so it uses its own self contained binary for node.

Heavily reduced traceback:

ValueError: invalid literal for int() with base 10: '0-alpha'
[...]
subprocess.CalledProcessError: Command '['/builds/worker/checkouts/vcs/.venv/bin/python', '-m', 'nodeenv', '/builds/worker/.cache/pyright-python/nodeenv']' returned non-zero exit status 1.
[...]
RuntimeError: nodeenv failed; for more reliable node.js binaries try `pip install pyright[nodejs]`

This is the same as taskcluster/taskgraph#1086

The CI image has no global node, so pyright falls back to running `python
-m nodeenv` to download one, which ends up downloading
`v27.0.0-alpha.0.0.0`. It then tries parsing that version and fails
miserably because it assumes it's going to be `[major].[minor].[patch]`,
all ints and calls `int("0-alpha")`. So do what pyright suggests and
install `pyright[nodejs]` so it uses its own self contained binary for node.

Heavily reduced traceback:

```
ValueError: invalid literal for int() with base 10: '0-alpha'
[...]
subprocess.CalledProcessError: Command '['/builds/worker/checkouts/vcs/.venv/bin/python', '-m', 'nodeenv', '/builds/worker/.cache/pyright-python/nodeenv']' returned non-zero exit status 1.
[...]
RuntimeError: nodeenv failed; for more reliable node.js binaries try `pip install pyright[nodejs]`
```
@Eijebong
Eijebong requested a review from a team as a code owner November 2, 2026 11:16
@jcristau

jcristau commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

@Eijebong we should probably do the same in mozilla-releng/reps?

@Eijebong

Eijebong commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Probably yeah, I'll open a PR in a bit

@Eijebong

Eijebong commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

mozilla-releng/reps#170

@Eijebong
Eijebong merged commit 9d40f23 into mozilla-releng:main Nov 3, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants