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

Regression in 20.13.0 for Windows users - NPM not installed with node #52884

Closed
comcalvi opened this issue May 8, 2024 · 4 comments · Fixed by #52900
Closed

Regression in 20.13.0 for Windows users - NPM not installed with node #52884

comcalvi opened this issue May 8, 2024 · 4 comments · Fixed by #52900
Labels
npm Issues and PRs related to the npm client dependency or the npm registry. v20.x v20.x Issues that can be reproduced on v20.x or PRs targeting the v20.x-staging branch. windows Issues and PRs related to the Windows platform.

Comments

@comcalvi
Copy link

comcalvi commented May 8, 2024

Version

20.13.0

Platform

Windows

Subsystem

No response

What steps will reproduce the bug?

Install Node from chocolatey:

C:\\ProgramData\\chocolatey\\bin\\choco.exe upgrade nodejs-lts -y

(the output confirms the node version is 20.13.0):

Version 20.13.0 is available based on your source(s).

Then run an npm command:

npm init -y

This fails with:

Error: Cannot find module 'C:\Users\ContainerAdministrator\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
    at Module._load (node:internal/modules/cjs/loader:986:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

I was able to fix this by pinning the version to 20.12.2:

C:\\ProgramData\\chocolatey\\bin\\choco.exe upgrade nodejs-lts -y --version 20.12.2

This only broke our Windows build, confirmed it did not affect Ubuntu.

How often does it reproduce? Is there a required condition?

Every time

What is the expected behavior? Why is that the expected behavior?

NPM CLI should be available for Windows users

What do you see instead?

Error: Cannot find module 'C:\Users\ContainerAdministrator\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
    at Module._load (node:internal/modules/cjs/loader:986:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Additional information

No response

@targos
Copy link
Member

targos commented May 8, 2024

This is #52682

@nodejs/lts

@RedYetiDev RedYetiDev added npm Issues and PRs related to the npm client dependency or the npm registry. v20.x v20.x Issues that can be reproduced on v20.x or PRs targeting the v20.x-staging branch. duplicate Issues and PRs that are duplicates of other issues or PRs. windows Issues and PRs related to the Windows platform. and removed duplicate Issues and PRs that are duplicates of other issues or PRs. labels May 8, 2024
@RedYetiDev
Copy link
Member

(Sorry, I mislabeled this as duplicate)

@richardlau
Copy link
Member

This is #52682

@nodejs/lts

We should have held off landing #52009 on LTS in light of #52682. I see the baking-for-lts PRs that need to wait before landing in a LTS release. label was added to it, so presumably there was either a race (it was already on staging before the label was applied) or a mistake when using the tooling (e.g. branch-diff).

pento pushed a commit to WordPress/wordpress-develop that referenced this issue May 8, 2024
The `check-latest` setting is used to ensure the latest version of Node.js is always installed in GitHub Action workflows.

This input was added and turned on in [57212] when the minimum required version of Node.js was bumped to `20.10.0`. Because GitHub Action runner image updates are deployed on a rolling basis over the course of several days, a version of Node.js that met this new requirement was not always present (especially on Windows runners). Using this input was a temporary fix to ensure stability for Core’s test workflows. 

The `check-latest` input does have some side effects. Two examples are:
- An additional request is performed to check the latest version every time `setup-node` is used with this option enabled. More requests are made to download and install a newer version of Node.js when one is available.
- When new versions of Node.js are released, the Core workflows immediately switch to the new version, which could potentially have undiscovered bugs or regressions.

The latter has surfaced today due to a regression in Node.js 20.13.0 on Windows (see nodejs/node#52884).

A bit of time has passed and a version >=20.10.0 is now reliably available on all GitHub Action runners. Running the very latest release Node.js is also not important for Core’s testing setup, so `check-version` can safely be removed to address both side effects detailed above. 

Props johnbillion.
Fixes #60129.

git-svn-id: https://develop.svn.wordpress.org/trunk@58120 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this issue May 8, 2024
The `check-latest` setting is used to ensure the latest version of Node.js is always installed in GitHub Action workflows.

This input was added and turned on in [57212] when the minimum required version of Node.js was bumped to `20.10.0`. Because GitHub Action runner image updates are deployed on a rolling basis over the course of several days, a version of Node.js that met this new requirement was not always present (especially on Windows runners). Using this input was a temporary fix to ensure stability for Core’s test workflows. 

The `check-latest` input does have some side effects. Two examples are:
- An additional request is performed to check the latest version every time `setup-node` is used with this option enabled. More requests are made to download and install a newer version of Node.js when one is available.
- When new versions of Node.js are released, the Core workflows immediately switch to the new version, which could potentially have undiscovered bugs or regressions.

The latter has surfaced today due to a regression in Node.js 20.13.0 on Windows (see nodejs/node#52884).

A bit of time has passed and a version >=20.10.0 is now reliably available on all GitHub Action runners. Running the very latest release Node.js is also not important for Core’s testing setup, so `check-version` can safely be removed to address both side effects detailed above. 

Props johnbillion.
Fixes #60129.
Built from https://develop.svn.wordpress.org/trunk@58120


git-svn-id: http://core.svn.wordpress.org/trunk@57585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
github-actions bot pushed a commit to gilzow/wordpress-performance that referenced this issue May 8, 2024
The `check-latest` setting is used to ensure the latest version of Node.js is always installed in GitHub Action workflows.

This input was added and turned on in [57212] when the minimum required version of Node.js was bumped to `20.10.0`. Because GitHub Action runner image updates are deployed on a rolling basis over the course of several days, a version of Node.js that met this new requirement was not always present (especially on Windows runners). Using this input was a temporary fix to ensure stability for Core’s test workflows. 

The `check-latest` input does have some side effects. Two examples are:
- An additional request is performed to check the latest version every time `setup-node` is used with this option enabled. More requests are made to download and install a newer version of Node.js when one is available.
- When new versions of Node.js are released, the Core workflows immediately switch to the new version, which could potentially have undiscovered bugs or regressions.

The latter has surfaced today due to a regression in Node.js 20.13.0 on Windows (see nodejs/node#52884).

A bit of time has passed and a version >=20.10.0 is now reliably available on all GitHub Action runners. Running the very latest release Node.js is also not important for Core’s testing setup, so `check-version` can safely be removed to address both side effects detailed above. 

Props johnbillion.
Fixes #60129.
Built from https://develop.svn.wordpress.org/trunk@58120


git-svn-id: https://core.svn.wordpress.org/trunk@57585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
@richardlau richardlau linked a pull request May 9, 2024 that will close this issue
undergroundwires added a commit to undergroundwires/privacy.sexy that referenced this issue May 9, 2024
This commit addresses the issue where Windows GitHub runners experience
failures due to unstable Node.js releases, particularly version 20.13.0,
as detailed in nodejs/node#52884 and nodejs/node#52682.

The 'check-latest' input in the 'setup-node' GitHub Action forces
every job to verify and potentially install the latest Node.js version.
This input was originally introduced to reduce maintenance efforts to
keep CI/CD setup up-to-date with the latest Node version.

However, the necessity to always run the latest Node.js version is not
critical for the CI/CD setup. Additionally, it causes increate network
requests and may inadvertently introduce unstable Node.js versions.

This commit removes the 'check-latest' option to prevent the immediate
adoption of new, potentially unstable Node.js releases, thus simplifying
the CI/CD pipeline. This keeps  CI/CD process is robust and predictable,
reducing the chances of unexpected disruptions in service deployment.
@marco-ippolito
Copy link
Member

This should have been fixed with v20.13.1

undergroundwires added a commit to undergroundwires/privacy.sexy that referenced this issue May 10, 2024
This commit addresses the issue where Windows GitHub runners experience
failures due to unstable Node.js releases, particularly version 20.13.0,
as detailed in nodejs/node#52884 and nodejs/node#52682.

The 'check-latest' input in the 'setup-node' GitHub Action forces
every job to verify and potentially install the latest Node.js version.
This input was originally introduced to reduce maintenance efforts to
keep CI/CD setup up-to-date with the latest Node version.

However, the necessity to always run the latest Node.js version is not
critical for the CI/CD setup. Additionally, it causes increased network
requests and may inadvertently introduce unstable Node.js versions.

This commit removes the 'check-latest' option to prevent the immediate
adoption of new, potentially unstable Node.js releases, thus simplifying
the CI/CD pipeline. This keeps  CI/CD process is robust and predictable,
reducing the chances of unexpected disruptions in service deployment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
npm Issues and PRs related to the npm client dependency or the npm registry. v20.x v20.x Issues that can be reproduced on v20.x or PRs targeting the v20.x-staging branch. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants