Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: don't install latest npm #168

Merged
merged 2 commits into from
Oct 26, 2023
Merged

ci: don't install latest npm #168

merged 2 commits into from
Oct 26, 2023

Conversation

fasttime
Copy link
Member

@fasttime fasttime commented Oct 24, 2023

This PR fixes the CI test jobs.

Currently, the jobs will attempt to install the latests version of npm regardless of the installed version of Node.js. This has been problematic since the release of npm 10, because npm 10 does not support all versions of Node.js that this package supports.

The fix is to explicitly indicate which version of npm (currently 9 or 10) should be installed along with Node.js. Upgrading npm doesn't seem necessary, so removing that step will fix the build.

@bmish
Copy link
Member

bmish commented Oct 24, 2023

Is there precedence for this solution? Curious if other repositories have to do this too or if there is a simpler solution.

@fasttime
Copy link
Member Author

Other repos I know just don't bother upgrading npm, and will use whatever version comes bundled with Node.js via actions/setup-node.

@bmish
Copy link
Member

bmish commented Oct 24, 2023

I see. I don't see why we need to manually install/update npm in each of our Node version tests. If we need to install the latest npm manually at all, likely we only need to do that alongside the latest Node version, and not bother touching it for the other Node version tests. That way, we don't have to maintain this mapping of Node versions to npm versions.

@fasttime
Copy link
Member Author

Fair point. The npm upgrade was introduced in this commit alongside other changes. At that time there were only three versions of Node.js to be tested, and the latest npm was version 7. I don't know what was the reason for manually upgrading npm, but if it's no longer necessary, I'd be happy to take it out and stick with the pre-installed version.

@nzakas
Copy link
Member

nzakas commented Oct 25, 2023

Yeah, I don't think this is necessary. I'd rather update the supported Node.js versions and use the bundled npm to fix this problem. We're free to introduce breaking changes here whenever we want because this package is a CLI tool that generates code, so there are no real backcompat concerns.

@fasttime fasttime changed the title ci: only use supported versions of npm ci: don't install latest npm Oct 26, 2023
@fasttime
Copy link
Member Author

I have removed the step that was installing npm. There is already PR #167 to add Node.js 21 to the list of versions to be tested.

@fasttime fasttime marked this pull request as ready for review October 26, 2023 14:25
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

@nzakas nzakas merged commit 837bde0 into main Oct 26, 2023
10 checks passed
@nzakas nzakas deleted the fix-ci-tests branch October 26, 2023 15:12
@github-actions github-actions bot mentioned this pull request Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants