Skip to content

Install standard version of Node.js in "Deploy Website" workflow #798

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

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Oct 16, 2024

The "Deploy Website" workflow invokes the following chain of tasks:

  1. docs:generate
  2. general:format-prettier

This makes the Prettier tool a dependency of the workflow, which in turn introduces a dependency on npm, and thus on Node.js.

Previously, the workflow didn't contain a step to run the "actions/setup-node" action, so it used whichever version of npm happened to be installed in the runner machine, which happens to be 18.x currently. Now that the use of the project's standard Node.js version 20.x is enforced, this caused the workflow runs to fail spuriously:

task: [npm:install-deps] npm install
npm error code EBADENGINE
npm error engine Unsupported engine
npm error engine Not compatible with your version of node/npm: undefined
npm error notsup Not compatible with your version of node/npm: undefined
npm error notsup Required: {"node":"20.x"}
npm error notsup Actual:   {"npm":"10.7.0","node":"v18.20.4"}

npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2024-10-16T07_28_37_785Z-debug-0.log
task: Failed to run task "docs:generate": exit status 1

The problem is solved by adding an "actions/setup-node" action step to the workflow to install the correct version of Node.js.

The "Deploy Website" workflow invokes the following chain of tasks:

1. `docs:generate`
2. `general:format-prettier`

This makes the Prettier tool a dependency of the workflow, which in turn introduces a dependency on npm, and thus on
Node.js.

Previously, the workflow didn't contain a step to run the "actions/setup-node" action, so it used whichever version of
npm happened to be installed in the runner machine, which happens to be 18.x currently. Now that the use of the
project's standard Node.js version 20.x is enforced, this caused the workflow runs to fail spuriously:

```
task: [npm:install-deps] npm install
npm error code EBADENGINE
npm error engine Unsupported engine
npm error engine Not compatible with your version of node/npm: undefined
npm error notsup Not compatible with your version of node/npm: undefined
npm error notsup Required: {"node":"20.x"}
npm error notsup Actual:   {"npm":"10.7.0","node":"v18.20.4"}

npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2024-10-16T07_28_37_785Z-debug-0.log
task: Failed to run task "docs:generate": exit status 1
```

The problem is solved by adding an "actions/setup-node" action step to the workflow to install the correct version of
Node.js.
@per1234 per1234 added topic: documentation Related to documentation for the project topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project labels Oct 16, 2024
@per1234 per1234 self-assigned this Oct 16, 2024
@per1234 per1234 merged commit 4ee89da into arduino:main Oct 16, 2024
8 checks passed
@per1234 per1234 deleted the deploy-website-npm branch October 16, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: documentation Related to documentation for the project topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant