Errors Using node.js CI workflow

jennifer

I am receiving errors after running workflows in Github Actions using Node.js CI. I believe the problem is with the yml file based on the following errors:

build (18.x) Process completed with exit code 32. build (16.x) The operation was canceled.

build (18.x) The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, actions/setup-node@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/

build (16.x) The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, actions/setup-node@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/

The error is occuring on the "run npm test" step. I'm not sure if this is an issue with the yml file but it is mentioned in the links on the error codes:

Here is the yml file:

name: Node.js CI

on:
  workflow_dispatch:
  push:
  pull_request:

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [16.x,18.x]

    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - run: npm ci
    - run: npm start &
    - run: npm test
Robin Thomas

Your GitHub Actions are outdated and do not support Node.js v16 or v18 (which are the versions you are using, as evident from your matrix strategy). Hence why you get the error.

You can fix the error by using actions/checkout@v4 and actions/setup-node@v3:

steps:
    - uses: actions/checkout@v4
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v3
      with:
        node-version: ${{ matrix.node-version }}

Both actions/checkout@v2 and actions/setup-node@v1 support only up to Node.js v12.

actions/setup-node@v3 supports Node.js 18 since v3.7.0: https://github.com/actions/setup-node/releases/tag/v3.7.0

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Share workflow to set up CI with Node and Yarn

Continuous deployment for node.js applications using CI and CodeDeploy

Travis CI not using correct node.js version

Node JS with typescript failing to catch express errors using middleware

How to render errors from node.js in react using fetch

Managing image workflow with Node.js webapp?

Docker development workflow with node.js

What is a good workflow for Continuous Deployment to a VPS using Travis CI and Capistrano?

Catching errors in Node.js

handling multiple errors in Node js

Access env variables in node js app when using gitlab ci cd pipeline

Node js unable to catch errors when sending an email using AWS SES

I keep getting validator errors after submitting my form in Node.js using EJS templating engine

Pass errors from nginx to node.js when using nginx as a proxy server

node.js saving form data using mongoose/mongodb/express has errors and wont work?

Passing custom errors back to AWS API Gateway from AWS Lambda using node.js

Apache Kafka, node js and Point-to-point workflow

whats the workflow of Azure Bot Framework Program (Node.js)?

CI cmake workflow not building as expected

How do check node js errors in Azure

Node.js: how to inspect errors?

NPM Errors in Node.js webapp

Node.js Express handle errors function

handle errors and exceptions logging in node.js

How to handle errors in Node.js/express

node.js - Require Exports Variables Errors

node.js sqlanywhere compilation/update errors

node.js install errors on mac

String Concatenation Errors in ejs / node.js